{"version":3,"sources":["../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/axisTickLabelBuilder.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/Axis.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/data/DataDiffer.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/GeoSVGResource.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/fix/nanhai.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/fix/textCoord.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/fix/geoCoord.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/fix/diaoyuIsland.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/GeoJSONResource.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/geoSourceManager.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/CoordinateSystem.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/axisModelCommonMixin.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/core/CoordinateSystem.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/View.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/axisCommonTypes.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/axisModelCreator.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/core/locale.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/core/task.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/data/DataStore.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/scaleRawExtentInfo.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/parseGeoJson.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/Region.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/data/Tree.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/data/SeriesDimensionDefine.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/data/OrdinalMeta.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/single/singleAxisHelper.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/axisDefault.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/Geo.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/geoCreator.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/single/AxisModel.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/cartesian/AxisModel.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/parallel/AxisModel.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/polar/AxisModel.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/axisHelper.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/cartesian/GridModel.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/radar/RadarModel.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/GeoModel.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/data/Graph.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/parallel/ParallelModel.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/parallel/parallelPreprocessor.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/cartesian/prepareCustom.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/geo/prepareCustom.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/single/prepareCustom.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/polar/prepareCustom.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/calendar/prepareCustom.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/polar/PolarModel.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/calendar/CalendarModel.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/calendar/Calendar.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/cartesian/Cartesian.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/cartesian/Cartesian2D.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/cartesian/Axis2D.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/cartesian/Grid.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/polar/RadiusAxis.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/polar/AngleAxis.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/polar/Polar.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/polar/polarCreator.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/parallel/ParallelAxis.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/parallel/Parallel.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/parallel/parallelCreator.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/single/SingleAxis.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/single/Single.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/single/singleCreator.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/radar/IndicatorAxis.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/coord/radar/Radar.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/data/SeriesData.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/core/ExtensionAPI.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/core/Scheduler.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/core/lifecycle.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/core/echarts.js","../node_modules/@dhi/react-components/node_modules/echarts/lib/data/Source.js"],"names":["inner","makeInner","createAxisLabels","axis","type","labelModel","getLabelModel","result","makeCategoryLabelsActually","get","scale","isBlank","labels","labelCategoryInterval","makeCategoryLabels","ticks","getTicks","labelFormatter","makeLabelFormatter","zrUtil","tick","idx","formattedLabel","rawLabel","getLabel","tickValue","value","makeRealNumberLabels","createAxisTicks","tickModel","tickCategoryInterval","ticksCache","getListCache","optionTickInterval","getOptionCategoryInterval","listCacheGet","makeLabelsByCustomizedCategoryInterval","labelsResult","labelItem","makeLabelsByNumericCategoryInterval","listCacheSet","makeCategoryTicks","numericLabelInterval","labelsCache","optionLabelInterval","autoInterval","calculateCategoryInterval","makeAutoCategoryInterval","prop","cache","key","i","length","push","categoryInterval","onlyTick","ordinalScale","ordinalExtent","getExtent","step","Math","max","startTick","tickCount","count","round","ceil","showAllLabel","shouldShowAllLabels","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","Axis","dim","extent","this","onBand","inverse","_extent","prototype","contain","coord","min","containData","data","slice","getPixelPrecision","dataExtent","setExtent","start","end","dataToCoord","clamp","normalize","fixExtentWithBands","linearMap","coordToData","t","pointToData","point","getTicksCoords","opt","getTickModel","ticksCoords","map","tickVal","getRawOrdinalNumber","alignWithLabel","ticksLen","last","diffSize","axisExtent","crossLen","shift_1","each","ticksItem","littleThan","shift","unshift","pop","a","b","fixOnBandTicksCoords","getMinorTicksCoords","splitNumber","model","getModel","minorTicks","getMinorTicks","minorTicksGroup","minorTick","getViewLabels","getBandWidth","len","size","abs","params","axisRotate","getRotate","isHorizontal","labelRotate","font","getFont","fetchAutoCategoryIntervalCalculationParams","rotation","PI","floor","unitSpan","unitW","cos","unitH","sin","maxW","maxH","width","height","rect","textContain","dw","dh","isNaN","Infinity","interval","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","nTick","margin","dataIndexMapValueLength","valNumOrArrLengthMoreThan2","defaultKeyGetter","item","DataDiffer","oldArr","newArr","oldKeyGetter","newKeyGetter","context","diffMode","_old","_new","_oldKeyGetter","_newKeyGetter","_diffModeMultiple","add","func","_add","update","_update","updateManyToOne","_updateManyToOne","updateOneToMany","_updateOneToMany","updateManyToMany","_updateManyToMany","remove","_remove","execute","_executeOneToOne","newDataIndexMap","oldDataKeyArr","Array","newDataKeyArr","_initIndexMap","oldKey","newIdxMapVal","newIdxMapValLen","newIdx","_performRestAdd","_executeMultiple","oldDataIndexMap","oldIdxMapVal","oldIdxMapValLen","i_1","newKey","idxMapValLen","j","arr","keyArr","keyGetterName","cbModeMultiple","idxMapVal","REGION_AVAILABLE_SVG_TAG_MAP","createHashMap","GeoSVGResource","mapName","svg","_usedGraphicMap","_freedGraphics","_mapName","_parsedXML","parseXML","load","firstGraphic","_firstGraphic","_buildGraphic","_boundingRect","boundingRect","clone","_a","named","regions","regionsMap","namedItem","namedFrom","region","GeoSVGRegion","name","el","set","createRegions","_regions","_regionsMap","svgXML","rootFromParse","parseSVG","ignoreViewBox","ignoreRootClip","root","assert","e","Error","message","Group","isGeoSVGGraphicRoot","svgWidth","svgHeight","viewBoxRect","bRectX","bRectY","bRectWidth","bRectHeight","x","y","calculatedBoundingRect","getBoundingRect","BoundingRect","viewBoxTransform","makeViewBoxTransform","scaleX","scaleY","setClipPath","Rect","shape","plain","svgNodeTagLower","silent","isGroup","traverse","child","useGraphic","hostKey","usedRootMap","svgGraphic","freeGraphic","removeKey","geoCoord","nanhaiName","points","k","coordsOffsetMap","geoCoordMap","GeoJSONResource","geoJSON","specialAreas","source","_parsedMap","_specialAreas","_geoJSON","isString","JSON","parse","Function","nameMap","nameProperty","parsed","rawRegions","_parseToRegions","calculateBoundingRect","finalRegions","regionName","hasOwnProperty","cloneShallow","parseGeoJson","mapType","GeoJSONRegion","exterior","fixNanhai","coordFix","cp","getCenter","setCenter","fixTextCoord","fixGeoCoord","geometries","fixDiaoyuIsland","specialArea","transformTo","left","top","getMapForUser","geoJson","regionRect","union","storage","registerMap","rawDef","rawSpecialAreas","resource","features","getGeoResource","isCoordinateSystemType","coordSys","AxisModelCommonMixin","getNeedCrossZero","option","getCoordSysModel","coordinateSystemCreators","CoordinateSystemManager","_coordinateSystems","create","ecModel","api","coordinateSystems","creater","list","concat","getCoordinateSystems","register","creator","v2ApplyTransform","vector","View","_super","_this","call","dimensions","_roamTransformable","Transformable","_rawTransformable","__extends","setBoundingRect","_rect","setViewRect","_transformTo","_viewRect","rawTransform","transform","calculateTransform","rawParent","parent","decomposeTransform","_updateTransform","centerCoord","_center","_updateCenterAndZoom","setZoom","zoom","zoomLimit","_zoom","getDefaultCenter","rawRect","getZoom","getRoamTransform","getLocalTransform","rawTransformMatrix","roamTransform","defaultCenter","center","originX","originY","roamTransformable","rawTransformable","updateTransform","matrix","_rawTransform","invTransform","getTransformInfo","dummyTransformable","roam","raw","getViewRect","getViewRectAfterRoam","applyTransform","dataToPoint","noRoam","out","convertToPixel","finder","getCoordSys","convertFromPixel","pixel","containPoint","seriesModel","coordinateSystem","AXIS_TYPES","category","time","log","axisModelCreator","registers","axisName","BaseAxisModelClass","extraDefaultOption","v","axisType","defaultOption","merge","axisDefault","AxisModel","apply","arguments","mergeDefaultAndTheme","layoutMode","fetchLayoutMode","inputPositionParams","getLayoutParams","themeModel","getTheme","getDefaultOption","getAxisType","mergeLayoutParam","optionUpdated","__ordinalMeta","OrdinalMeta","createByAxisModel","getCategories","rawData","categories","getOrdinalMeta","registerComponentModel","registerSubTypeDefaulter","layout","gridModel","axisModel","grid","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","position","axisPosition","axisDim","getRect","rectBound","right","bottom","onZero","axisOffset","posBound","onZeroCoord","toGlobalCoord","labelDirection","tickDirection","nameDirection","labelOffset","labelInside","z2","isCartesian2DSeries","findAxisModels","axisModelMap","xAxisModel","yAxisModel","replace","getReferringComponents","SINGLE_REFERRING","models","LOCALE_ZH","LOCALE_EN","DEFAULT_LOCALE","localeStorage","localeModels","SYSTEM_LANG","env","domSupported","document","documentElement","lang","navigator","language","browserLanguage","toUpperCase","indexOf","registerLocale","locale","localeObj","Model","createLocaleObject","getLocaleModel","getDefaultLocaleModel","langEN","langZH","createTask","define","Task","_reset","reset","_plan","plan","_count","_onDirty","onDirty","_dirty","perform","performArgs","planResult","upTask","_upstream","skip","outputData","__pipeline","currentTask","forceFirstProgress","lastModBy","normalizeModBy","_modBy","lastModDataCount","_modDataCount","modBy","modDataCount","val","_doReset","_dueEnd","_outputDueEnd","_progress","_dueIndex","progress","isArray","_doProgress","outputDueEnd","_settedOutputEnd","process","unfinished","dirty","iterator","_callingProgress","next","downstream","_downstream","pipe","downTask","dispose","_disposed","getUpstream","getDownstream","setOutputEnd","current","winCount","it","s","sStep","sCount","modNext","sequentialNext","dataIndex","defaultDimValueGetters","UNDEFINED","CtorUint32Array","Uint32Array","CtorUint16Array","Uint16Array","CtorInt32Array","Int32Array","CtorFloat64Array","Float64Array","dataCtors","getIndicesCtor","rawCount","cloneChunk","originalChunk","Ctor","constructor","prepareStore","store","dimIdx","dimType","append","DataCtor","oldStore","oldLen","newStore","DataStore","_chunks","_rawExtent","_rawCount","_calcDimNameToIdx","initData","provider","inputDimensions","dimValueGetter","_provider","_indices","getRawIndex","_getRawIdxIdentity","getSource","defaultGetter","defaultDimValueGetter","sourceFormat","_dimValueGetter","shouldRetrieveDataByName","_dimensions","property","_initDataFromProvider","getProvider","ensureCalculationDimension","dimName","calcDimNameToIdx","calcDimIdx","collectOrdinalMeta","ordinalMeta","chunk","rawExtents","offset","ordinalOffset","dimRawExtent","parseAndCollect","getDimensionProperty","dimIndex","appendData","persistent","appendValues","values","minFillLen","chunks","dimLen","rawExtent","emptyDataItem","sourceIdx","arrayRows","dimNames","fillStorage","dataItem","getItem","dimStorage","clean","NaN","dimStore","getValues","dimArr","getByRawIndex","rawIdx","getSum","sum","getMedian","dimDataArray","sortedDimDataArray","sort","indexOfRawIndex","rawIndex","indices","rawDataIndex","mid","indicesOfNearest","maxDistance","dimData","nearestIndices","minDist","minDiff","nearestIndicesLen","diff","dist","getIndices","newIndices","thisCount","buffer","filter","dims","cb","dimSize","dim0","keep","_updateGetRawIdx","selectRange","range","keys","originalCount","storeArr","quickFinished","dimStorage2","min2","max2","val2","dimk","target","_updateDims","modify","targetChunks","tmpRetValue","dataCount","retValue","rawExtentOnDim","lttbDownSample","valueDimension","rate","maxArea","area","nextRawIndex","sampledIndex","frameSize","currentRawIndex","nextFrameStart","nextFrameEnd","avgX","avgY","frameStart","frameEnd","pointAX","pointAY","_getRawIdx","downSample","dimension","sampleValue","sampleIndex","targetStorage","frameValues","dataIdx","sampleFrameIdx","getDataExtent","initialExtent","dimExtent","currEnd","getRawDataItem","clonedDims","ignoreIndices","clonedDimsMap","reduce","obj","_copyCommonProps","_cloneIndices","internalField","getDimValueSimply","parseDataValue","objectRows","keyedColumns","original","typedArray","ScaleRawExtentInfo","originalExtent","_prepareParams","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","modelMinRaw","_modelMinRaw","isFunction","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","boundaryGap","boundaryGapArr","_boundaryGapInner","parsePercent","calculate","dataMin","dataMax","axisDataLen","boundaryGapInner","span","minFixed","maxFixed","isFinite","eqNaN","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","freeze","frozen","ensureScaleRawExtentInfo","rawExtentInfo","minMax","decodePolygon","coordinate","encodeOffsets","encodeScale","prevX","prevY","charCodeAt","parseGeoJSON","json","UTF8Encoding","jsonCompressed","UTF8Scale","f","geometry","coordinates","c","c2","decode","featureObj","properties","geo","interiors","TMP_TRANSFORM","Region","MAX_NUMBER","Number","MAX_VALUE","bbox","vec2","loopGeo","polygonContain","aspect","p","h","copy","newRegion","elOnlyForCalculate","_elOnlyForCalculate","_calculateCenter","mat","TreeNode","hostTree","depth","children","viewChildren","isExpand","isRemoved","eachNode","options","order","suppressVisitSub","attr","updateDepthAndHeight","getNodeById","id","getId","res","contains","node","getAncestors","includeSelf","ancestors","parentNode","reverse","getAncestorsIndices","currNode","getDescendantIndices","childNode","getValue","getStore","getDimensionIndex","setLayout","setItemLayout","getLayout","getItemLayout","path","getItemModel","getLevelModel","levelModels","setVisual","setItemVisual","getVisual","getItemVisual","getChildIndex","isAncestorOf","isDescendantOf","Tree","hostModel","_nodes","getNodeByDataIndex","nodes","clearLayouts","clearItemLayouts","createTree","dataRoot","beforeLink","tree","listData","dimMax","buildHierarchy","dataNode","convertOptionIdName","addChild","prepareSeriesDataSchema","coordDimensions","dimensionsCount","SeriesData","linkSeriesData","mainData","struct","structAttr","SeriesDimensionDefine","otherDims","uidBase","_needCollect","needCollect","_deduplication","deduplication","uid","getName","dedplication","getOrdinal","_getOrCreateMap","index","_map","isObject","single","orient","positionMap","horizontal","vertical","labelRotation","rotate","show","zlevel","z","nameLocation","nameRotate","nameTruncate","maxWidth","ellipsis","placeholder","nameTextStyle","nameGap","triggerEvent","tooltip","axisPointer","axisLine","onZeroAxisIndex","lineStyle","color","symbol","symbolSize","axisTick","inside","axisLabel","showMinLabel","showMaxLabel","fontSize","splitLine","splitArea","areaStyle","categoryAxis","valueAxis","minorSplitLine","timeAxis","rich","primary","fontWeight","logAxis","logBase","GEO_DEFAULT_PARAMS","aspectScale","invertLongitute","geo2DDimensions","Geo","_nameCoordMap","geoSourceManager","resourceType","defaultParmas","_invertLongitute","getRegion","getRegionByCoord","addGeoCoord","getGeoCoord","geoModel","resizeGeo","boundingCoords","leftTop","rightBottom","viewRect","centerOption","sizeOption","viewWidth","getWidth","viewHeight","getHeight","useCenterAndSize","numberUtil","boxLayoutOption","getBoxLayoutParams","geoCreator","GeoCreator","geoList","eachComponent","resize","eachSeries","geoIndex","mapModelGroupBySeries","eachSeriesByType","getHostGeoModel","getMapType","mapSeries","nameMapList","singleMapSeries","setGeoCoords","getFilledRegions","originRegionArr","regionsArr","dataNameMap","SingleAxisModel","opacity","ComponentModel","mixin","CartesianAxisModel","ParallelAxisModel","activeIntervals","getAreaSelectStyle","makeStyleMapper","setActiveIntervals","intervals","getActiveState","PolarAxisModel","AngleAxisModel","RadiusAxisModel","getScaleExtent","scaleType","rawExtentResult","setBlank","barSeriesModels","prepareLayoutBarSeries","isBaseAxisAndHasBarSeries_1","getBaseAxis","barWidthAndOffset","makeColumnLayout","adjustedScale","axisLength","barsOnCurrentAxis","retrieveColumnLayout","undefined","minOverflow","maxOverflow","totalOverFlow","oldRange","overflowBuffer","adjustScaleForOverflow","fixMin","fixMax","niceScaleExtent","extentInfo","LogScale","base","niceExtent","minInterval","maxInterval","setInterval","createScaleByModel","OrdinalScale","TimeScale","useUTC","Scale","getClass","IntervalScale","ifAxisCrossZero","tpl","categoryTickStart","getFormattedLabel","label","getAxisRawValue","level","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","axisLabelModel","singleRect","rotateTextRect","getTextRect","textRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","getDataDimensionsOnAxis","dataDimMap","mapDimensionsAll","dataDim","getStackedDimension","unionAxisExtentFromData","seriesExtent","getApproximateExtent","GridModel","dependencies","containLabel","backgroundColor","borderWidth","borderColor","valueAxisDefault","defaultsShow","RadarModel","showName","nameFormatter","indicatorModels","indicatorOpt","iNameTextStyle","innerIndicatorOpt","text","indName","mainType","componentIndex","_indicatorModels","getIndicatorModels","radius","startAngle","axisNameGap","indicator","GeoModel","init","parentModel","itemStyle","modelUtil","selectedMap","_optionModelMap","optionModelMap","regionOpt","selected","getRegionModel","status","regionModel","formatter","select","selectedMode","unSelect","toggleSelected","isSelected","scaleLimit","emphasis","generateNodeKey","Graph","directed","edges","_nodesMap","_edgesMap","_directed","isDirected","addNode","nodesMap","GraphNode","hostGraph","getNodeByIndex","addEdge","n1","n2","edgesMap","edge","GraphEdge","outEdges","inEdges","getEdgeByIndex","edgeData","getEdge","eachEdge","node1","node2","breadthFirstTraverse","startNode","direction","edgeType","__visited","queue","currentNode","otherNode","filterSelf","graph","degree","inDegree","outDegree","getAdjacentDataIndices","dataIndices","adjacentEdge","createGraphDataProxyMixin","hostName","dataName","getGraphicEl","getItemGraphicEl","ParallelModel","mergeOption","newOption","thisOption","_initDimensions","parallelIndex","getComponent","setAxisExpand","parallelAxisIndex","axisModels","queryComponents","axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandRate","axisExpandDebounce","axisExpandSlideTriggerArea","axisExpandTriggerOn","parallelAxisDefault","parallelPreprocessor","parallel","hasParallelSeries","series","seriesOpt","createParallelIfNeeded","axes","parallelAxis","axisOption","parallelOption","mergeAxisOptionFromParallel","dataToCoordSize","dataSize","getAxis","halfSize","cartesianPrepareCustom","master","p1","p2","geoPrepareCustom","singlePrepareCustom","bind","polarPrepareCustom","radiusAxis","getRadiusAxis","angleAxis","getAngleAxis","cx","cy","r","r0","dataToRadius","angle","dataToAngle","coordToPoint","calendarPrepareCustom","rangeInfo","getRangeInfo","cellWidth","getCellWidth","cellHeight","getCellHeight","weeks","dayCount","allDay","PolarModel","findAxisModel","foundAxisModel","CalendarModel","mergeAndNormalizeLayoutParams","getCellSize","cellSize","dayLabel","firstDay","monthLabel","align","yearLabel","fontFamily","cellSizeArr","ignoreSize","hvIdx","sizeCalculable","PROXIMATE_ONE_DAY","Calendar","calendarModel","getDimensionsInfo","_model","_rangeInfo","_sw","_sh","getOrient","_orient","getFirstDayOfWeek","_firstDayOfWeek","getDateInfo","date","getFullYear","m","getMonth","mStr","d","getDate","dStr","day","getDay","getTime","formatedDate","getNextNDay","n","Date","setDate","_lineWidth","getItemStyle","lineWidth","_getRangeInfo","_initRangeOption","whNames","layoutParams","cellNumbers","cellSizeSpecified","whGlobal","calendarRect","dayInfo","week","nthWeek","pointToDate","dataToRect","contentShape","tl","tr","br","bl","nthX","nthY","_getDateByWeeksAndDay","console","warn","normalizedRange","rangeStr","toString","test","setMonth","tmp","reversed","parsedRange","startDateNum","endDateNum","dateNum","sign","fweek","lweek","nthDay","calendarList","calendar","calendarSeries","Cartesian","_dimList","_axes","getAxes","getAxesByScale","toLowerCase","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","yScaleExtent","xScaleSpan","yScaleSpan","translateX","translateY","invert","axisX","axisY","toLocalCoord","xVal","yVal","xAxis","yAxis","clampData","xScale","yScale","xAxisExtent","yAxisExtent","getOtherAxis","getArea","xExtent","getGlobalExtent","yExtent","Axis2D","coordExtent","asc","ret","setCategorySortInfo","info","categorySortInfo","setSortInfo","Grid","_coordsMap","_coordsList","_axesMap","_axesList","axisPointerEnabled","_initCartesian","axesMap","_updateScale","onZeroRecords","fixAxisOnZero","ignoreContainLabel","boxLayoutParams","isContainLabel","gridRect","getLayoutRect","axesList","adjustAxes","coordBase","axisExtentSum","updateAxisTransform","labelUnionRect","axisIndex","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","getCartesians","_findConvertTarget","cartesian","coordsList","axisPositionUsed","axesCount","createAxisCreator","isAxisUsedInTheGrid","isCategory","unionExtent","unionExtentFromData","axesModelMap","getData","getTooltipAxes","baseAxes","otherAxes","baseAxis","otherAxis","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","RadiusAxis","radiusExtent","polar","radiusToData","AngleAxis","angleExtent","angleToData","polarDimensions","polarModel","Polar","_radiusAxis","_angleAxis","pointToCoord","dx","dy","minAngle","maxAngle","sqrt","radian","atan2","dir","RADIAN","endAngle","clockwise","d2","updatePolarScale","data_1","setAxis","isAngleAxisModel","polarCreator","polarList","radiusAxisModel","angleAxisModel","parsedRadius","resizePolar","ParallelAxis","mathMin","mathMax","mathFloor","mathCeil","restrict","layoutAxisWithoutExpand","layoutInfo","layoutLength","axisCount","axisNameAvailableWidth","axisLabelShow","layoutAxisWithExpand","nameTruncateMaxWidth","axisCollapseWidth","winInnerIndices","axisExpandWindow0Pos","axisExpandWindow","Parallel","parallelModel","_axesLayout","_init","axisHelper","_updateAxesFromSeries","_makeLayoutInfo","axisBase","layoutBase","pixelDimIndex","pAxis","pLayout","mapDimension","layoutUtil","_layoutAxes","winSize","xy","wh","layoutExtent","posInfo","positionTable","rotationTable","axisCoordToPoint","eachActiveState","callback","dataDimensions","hasActiveSet","hasAxisBrushed","activeState","lenj","axisLayout","graphic","getAxisLayout","getSlidedAxisExpandWindow","behavior","delta","pointCoord","triggerArea","useJump","sliderMove","winSize2","parallelCoordSysCreator","coordSysList","SingleAxis","singleDimensions","singleModel","singleAxisModel","Single","_axis","_adjustAxis","_updateAxisTransform","extentSum","pt","singleCreator","singles","IndicatorAxis","Radar","radarModel","_indicatorAxes","indicatorModel","indicatorAxis","getIndicatorAxes","indicatorIndex","closestAxis","minRadianDiff","closestAxisIdx","viewSize","indicatorAxes","radarSeries","increaseInterval","exp10","pow","LN10","fixedMin","fixedMax","getInterval","radarList","radar","prepareInvertedIndex","getIdNameFromStore","normalizeDimensions","transferProperties","cloneListForMapAndSample","makeIdFromName","TRANSFERABLE_PROPERTIES","CLONE_PROPERTIES","dimensionsInput","_dimOmitted","_nameList","_idList","_visual","_layout","_itemVisuals","_itemLayouts","_graphicEls","_approximateExtent","_calculationInfo","hasItemOption","TRANSFERABLE_METHODS","CHANGABLE_METHODS","DOWNSAMPLE_METHODS","assignStoreDimIdx","isSeriesDataSchema","isDimensionOmitted","_schema","dimensionInfos","dimensionNames","invertedIndicesMap","needsHasOwn","emptyObj","dimInfoInput","dimensionInfo","dimensionName","coordDim","coordDimIndex","createInvertedIndices","itemName","_nameDimIdx","itemId","_idDimIdx","storeDimIndex","_dimInfos","_initGetDimensionInfo","_invertedIndicesMap","dimIdxToName_1","_dimIdxToName","getDimension","_recognizeDimIndex","sourceDimDef","getSourceDimension","dimInfo","_getDimInfo","getSourceDimensionIndex","_getStoreDimIndex","getDimensionInfo","getDimensionsOnCoord","_dimSummary","dataDimsOnCoord","dimensionsSummary","encodeFirstDimNotExtra","encode","_store","nameList","isSourceInstance","DefaultDataProvider","_nameRepeatCount","_doInit","summarizeDimensions","userOutput","names","shouldMakeIdFromName","_shouldMakeIdFromName","_updateOrdinalMeta","SOURCE_FORMAT_TYPED_ARRAY","idList","SOURCE_FORMAT_ORIGINAL","pure","sharedDataItem","isDataItemOption","setApproximateExtent","getCalculationInfo","setCalculationInfo","_getCategory","ordinal","hasValue","dataDimIndicesOnCoord","indexOfName","rawIndexOf","ctx","fCtx","dimIndices","innerRange","mapArray","ctxCompat","otherList","thisList","visual","kvObj","itemVisual","hasItemVisual","ensureUniqueItemVisual","itemVisuals","clearAllVisual","name_1","setItemGraphicEl","seriesIndex","setCommonECData","dataType","eachItemGraphicEl","wrapMethod","methodName","injectFunction","originalMethod","__wrappedMethods","invertedIndices","propName","nameDimIdx","idDimIdx","nameRepeatCount","nmCnt","availableMethods","ExtensionAPI","ecInstance","Scheduler","dataProcessorHandlers","visualHandlers","_stageTaskMap","_dataProcessorHandlers","_visualHandlers","_allHandlers","restoreData","payload","taskRecord","overallTask","getPerformArgs","task","isBlock","pipeline","_pipelineMap","pCtx","progressiveEnabled","progressiveRender","__idxInPipeline","blockIndex","getPipeline","pipelineId","updateStreamModes","view","dataLen","incrementalPrepareRender","threshold","large","pipelineContext","restorePipelines","scheduler","pipelineMap","progressive","getProgressive","head","tail","getProgressiveThreshold","preventIncremental","_pipe","dataTask","prepareStageTasks","stageTaskMap","handler","record","overallReset","_createSeriesStageTask","_createOverallStageTask","prepareView","renderTask","__block","performDataProcessorTasks","_performStageTasks","block","performVisualTasks","stageHandlers","needSetDirty","setDirty","dirtyMap","stageHandler","visualType","stageHandlerRecord","seriesTaskMap","overallNeedDirty_1","agentStubMap","stub","updatePayload","performArgs_1","performRawSeries","isSeriesFiltered","performSeriesTasks","oldSeriesTaskMap","newSeriesTaskMap","seriesType","getTargetSeries","seriesTaskPlan","seriesTaskReset","seriesTaskCount","useClearVisual","isVisual","isLayout","createOnAllSeries","eachRawSeries","eachRawSeriesByType","overallTaskReset","oldAgentStubMap","newAgentStubMap","overallProgress","shouldOverallTaskDirty","createStub","stubReset","stubOnDirty","agent","getSeries","wrapStageHandler","detectSeriseType","getUID","stubProgress","resetDefines","normalizeToArray","makeSeriesTaskProgress","singleSeriesTaskProgress","resetDefineIdx","resetDefine","dataEach","legacyFunc","ecModelMock","apiMock","mockMethods","Clz","noop","GlobalModel","cond","subType","lifecycle","Eventful","hasWindow","window","version","zrender","PRIORITY_VISUAL_GLOBAL","PRIORITY_VISUAL_CHART_DATA_CUSTOM","PRIORITY","PROCESSOR","FILTER","SERIES_FILTER","STATISTIC","VISUAL","LAYOUT","PROGRESSIVE_LAYOUT","GLOBAL","CHART","POST_CHART_LAYOUT","COMPONENT","BRUSH","CHART_ITEM","ARIA","DECAL","ACTION_REG","CONNECT_STATUS_KEY","createRegisterEventWithLowercaseECharts","method","args","_i","isDisposed","toLowercaseNameAndCallEventful","disposedWarning","createRegisterEventWithLowercaseMessageCenter","host","prepare","updateDirectly","updateMethods","doConvertPixel","doDispatchAction","flushPendingActions","triggerUpdatedEvent","bindRenderedEvent","bindMouseEvent","clearColorPalette","render","renderComponents","renderSeries","createExtensionAPI","enableConnect","markStatusToUpdate","applyChangedStates","MessageCenter","messageCenterProto","on","off","ECharts","dom","theme","opts","ECEventProcessor","_chartsViews","_chartsMap","_componentsViews","_componentsMap","_pendingActions","themeStorage","_dom","zr","_zr","renderer","devicePixelRatio","useDirtyRect","_throttledZrFlush","throttle","flush","backwardCompat","_theme","_locale","_coordSysMgr","_api","prioritySortFunc","__prio","timsort","visualFuncs","dataProcessorFuncs","_scheduler","_messageCenter","_initEvents","animation","_onframe","setAsPrimitive","updateParams","remainTime","startTime","getDom","getZr","setOption","notMerge","lazyUpdate","replaceMerge","transitionOpt","transition","optionManager","OptionManager","optionPreprocessorFuncs","seriesTransition","optionChanged","wakeUp","setTheme","error","getOption","getDevicePixelRatio","painter","dpr","getRenderedCanvas","canvasSupported","pixelRatio","getSvgDataURL","svgSupported","getDisplayList","stopAnimation","toDataURL","getDataURL","excludeComponents","excludesComponentViews","self","componentType","component","__viewId","group","ignore","url","getType","getConnectedDataURL","isSvg","groupId","connectedGroups","left_1","top_1","right_1","bottom_1","canvasList_1","dpr_1","instances","chart","canvas","getSvgDom","innerHTML","getBoundingClientRect","targetCanvas","createCanvas","zr_1","content_1","getSvgRoot","connectedBackgroundColor","setBackgroundColor","refreshImmediately","style","fill","img","image","containPixel","findResult","parsedFinder","defaultMainType","dataIndexInside","getItemVisualFromData","getVisualFromData","getViewOfComponentModel","componentModel","getViewOfSeriesModel","MOUSE_EVENT_NAMES","eveName","findEventDispatcher","ecData","getECData","dataModel","getSeriesByIndex","getDataParams","eventData","extend","event","_$eventProcessor","eventInfo","targetEl","packedEvent","trigger","zrEventfulCallAtLast","eventActionMap","actionType","eventType","handleLegacySelectEvents","clear","DOM_ATTRIBUTE_KEY","_loadingFX","needPrepare","resetOption","duration","showLoading","cfg","hideLoading","loadingEffects","makeActionFromEvent","eventObj","dispatchAction","actions","browser","weChat","updateLabelLayout","updatedSeries","applyElementStates","newStates","oldStates","currentStates","stateName","states","hoverState","HOVER_STATE_EMPHASIS","HOVER_STATE_BLUR","blur","useStates","updateZ","preventAutoZ","_updateZ","maxZ2","getTextContent","labelLine","getTextGuideLine","childrenRef","textGuideLineConfig","showAbove","clearStates","textContent","textGuide","stateTransition","hasState","prevStates","updateStates","stateAnimationModel","enableAnimation","isAnimationEnabled","delay","easing","savePathStates","__dirty","ecIns","isComponent","viewList","viewMap","__alive","doPrepare","requireNewView","__requireNewView","viewId","classType","parseClassType","ComponentView","main","sub","ChartView","__id","__model","__ecComponentInfo","splice","setUpdatePayload","query","condition","excludeSeriesIdMap","excludeSeriesId","modelId","isHighDownPayload","allLeaveBlur","SeriesModel","HIGHLIGHT_ACTION_TYPE","notBlur","blurSeriesFromHighlightPayload","findComponentHighDownDispatchers","focusSelf","dispatchers","blurComponent","dispatcher","enterEmphasis","leaveEmphasis","isSelectChangePayload","toggleSelectionFromPayload","updateSeriesElementSelection","callView","prepareAndUpdate","coordSysMgr","darkMode","setDarkMode","colorArr","colorTool","componentDirtyList","componentView","seriesDirtyMap","chartView","updateView","markUpdateMethod","updateVisual","updateLayout","chartsMap","payloadType","escapeConnect","actionWrap","actionInfo","cptTypeTmp","split","updateMethod","cptType","payloads","batched","batch","defaults","eventObjBatch","isSelectChange","isHighDown","batchItem","action","queryOptionMap","componentMainType","mainTypeSpecified","messageCenter","newObj","getAllSelectedIndices","isFromClick","fromAction","fromActionPayload","pendingActions","isFinished","isHighDownDispatcher","handleGlobalMouseOverForHighDown","handleGlboalMouseOutForHighDown","dirtyList","blendMode","blend","eachPendingDisplayable","displayable","updateBlend","elCount","worker","preventUsingHoverLayer","hoverLayer","updateHoverLayerStatus","class_1","getComponentByElement","modelInfo","highlightDigit","enterBlur","leaveBlur","enterSelect","leaveSelect","updateConnectedChartsStatus","charts","action_1","otherCharts_1","otherChart","echartsProto","one","eventName","deprecateLog","wrapped","args2","idBase","groupIdBase","existInstance","getInstanceByDom","connect","disConnect","disconnect","getInstanceById","registerTheme","registerPreprocessor","preprocessorFunc","registerProcessor","priority","processor","normalizeRegister","registerPostInit","postInitFunc","registerUpdateLifecycle","registerPostUpdate","postUpdateFunc","registerAction","registerCoordinateSystem","coordSysCreator","getCoordinateSystemDimensions","registerLayout","layoutTask","registerVisual","visualTask","registeredTasks","targetList","fn","defaultPriority","__raw","registerLoading","loadingFx","setCanvasCreator","$override","getMap","registerTransform","registerExternalTransform","seriesStyleTask","dataStyleTask","dataColorPaletteTask","seriesSymbolTask","dataSymbolTask","decal","dataStack","loadingDefault","DOWNPLAY_ACTION_TYPE","SELECT_ACTION_TYPE","UNSELECT_ACTION_TYPE","TOGGLE_SELECT_ACTION_TYPE","lightTheme","darkTheme","dataTool","SourceImpl","fields","SOURCE_FORMAT_KEYED_COLUMNS","SOURCE_FORMAT_UNKNOWN","seriesLayoutBy","SERIES_LAYOUT_BY_COLUMN","startIndex","dimensionsDetectedCount","metaRawOption","dimensionsDefine","guessOrdinal","BE_ORDINAL","Must","createSource","sourceData","thisMetaRawOption","detectSourceFormat","determined","sourceHeader","normalizeDimensionsOption","SOURCE_FORMAT_ARRAY_ROWS","dataArrayRows","arrayRowsTravelFirst","isNumber","SERIES_LAYOUT_BY_ROW","SOURCE_FORMAT_OBJECT_ROWS","firstIndex","dimensions_1","objectRowsCollectDimensions","colArr","value0","getDataItemValue","determineSourceDimensions","createSourceFromSeriesDataOption","isTypedArray","cloneSourceShallow","hasOwn","isArrayLike","rawItem","displayName","exist","maxLoop"],"mappings":"4KA+CIA,EAAQC,cACL,SAASC,EAAiBC,GAE/B,MAAqB,aAAdA,EAAKC,KAoBd,SAA4BD,GAC1B,IAAIE,EAAaF,EAAKG,gBAClBC,EAASC,EAA2BL,EAAME,GAC9C,OAAQA,EAAWI,IAAI,SAAWN,EAAKO,MAAMC,UAAY,CACvDC,OAAQ,GACRC,sBAAuBN,EAAOM,uBAC5BN,EA1B8BO,CAAmBX,GA+FvD,SAA8BA,GAC5B,IAAIY,EAAQZ,EAAKO,MAAMM,WACnBC,EAAiBC,YAAmBf,GACxC,MAAO,CACLS,OAAQO,MAAWJ,GAAO,SAAUK,EAAMC,GACxC,MAAO,CACLC,eAAgBL,EAAeG,EAAMC,GACrCE,SAAUpB,EAAKO,MAAMc,SAASJ,GAC9BK,UAAWL,EAAKM,WAvGuCC,CAAqBxB,GAW7E,SAASyB,EAAgBzB,EAAM0B,GAEpC,MAAqB,aAAd1B,EAAKC,KA0Cd,SAA2BD,EAAM0B,GAC/B,IAQId,EACAe,EATAC,EAAaC,EAAa7B,EAAM,SAChC8B,EAAqBC,YAA0BL,GAC/CtB,EAAS4B,EAAaJ,EAAYE,GAEtC,GAAI1B,EACF,OAAOA,EAOJsB,EAAUpB,IAAI,UAAWN,EAAKO,MAAMC,YACvCI,EAAQ,IAGV,GAAII,aAAkBc,GACpBlB,EAAQqB,EAAuCjC,EAAM8B,GAAoB,QAItE,GAA2B,SAAvBA,EAA+B,CACpC,IAAII,EAAe7B,EAA2BL,EAAMA,EAAKG,iBACzDwB,EAAuBO,EAAaxB,sBACpCE,EAAQI,MAAWkB,EAAazB,QAAQ,SAAU0B,GAChD,OAAOA,EAAUb,kBAInBV,EAAQwB,EAAoCpC,EAD5C2B,EAAuBG,GACiD,GAI5E,OAAOO,EAAa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vE,KAAMqvE,EAAQrvE,MAKhB,GAAiB,MAAb0K,EAAK4E,KACP,OAAO5E,EAITA,EAAK4E,MAAQ,GAMW,MAApB5E,EAAK4kE,cACP5kE,EAAK4kE,YAAc5kE,EAAK4E,MAG1B,IAAIigE,EAAQ/7D,EAAQnT,IAAIqK,EAAK4E,MAU7B,OARKigE,EAKH7kE,EAAK4E,MAAQ,IAAMigE,EAAM3rE,QAJzB4P,EAAQhE,IAAI9E,EAAK4E,KAAM,CACrB1L,MAAO,IAMJ8G,MAIX,SAAS2jE,EAAqBpiD,EAAIkhD,EAAgBjoE,EAAMsqE,GACtD,GAAIrC,IAAmBoB,IACrB,IAAK,IAAIxrE,EAAI,EAAGA,EAAImC,EAAKlC,QAAUD,EAAIysE,EAASzsE,IAC9CkpB,EAAG/mB,EAAKnC,GAAKmC,EAAKnC,GAAG,GAAK,KAAMA,OAGlC,KAAI8rE,EAAS3pE,EAAK,IAAM,GAExB,IAASnC,EAAI,EAAGA,EAAI8rE,EAAO7rE,QAAUD,EAAIysE,EAASzsE,IAChDkpB,EAAG4iD,EAAO9rE,GAAIA,IAKb,SAAS8kB,EAAyB7U,GACvC,IAAI2U,EAAe3U,EAAO2U,aAC1B,OAAOA,IAAiB6mD,KAA6B7mD,IAAiBslD","file":"static/js/29.bb211828.chunk.js","sourcesContent":["\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as textContain from 'zrender/lib/contain/text';\nimport { makeInner } from '../util/model';\nimport { makeLabelFormatter, getOptionCategoryInterval, shouldShowAllLabels } from './axisHelper';\nvar inner = makeInner();\nexport function createAxisLabels(axis) {\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryLabels(axis) : makeRealNumberLabels(axis);\n}\n/**\n * @param {module:echats/coord/Axis} axis\n * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea.\n * @return {Object} {\n * ticks: Array.\n * tickCategoryInterval: number\n * }\n */\n\nexport function createAxisTicks(axis, tickModel) {\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryTicks(axis, tickModel) : {\n ticks: zrUtil.map(axis.scale.getTicks(), function (tick) {\n return tick.value;\n })\n };\n}\n\nfunction makeCategoryLabels(axis) {\n var labelModel = axis.getLabelModel();\n var result = makeCategoryLabelsActually(axis, labelModel);\n return !labelModel.get('show') || axis.scale.isBlank() ? {\n labels: [],\n labelCategoryInterval: result.labelCategoryInterval\n } : result;\n}\n\nfunction makeCategoryLabelsActually(axis, labelModel) {\n var labelsCache = getListCache(axis, 'labels');\n var optionLabelInterval = getOptionCategoryInterval(labelModel);\n var result = listCacheGet(labelsCache, optionLabelInterval);\n\n if (result) {\n return result;\n }\n\n var labels;\n var numericLabelInterval;\n\n if (zrUtil.isFunction(optionLabelInterval)) {\n labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);\n } else {\n numericLabelInterval = optionLabelInterval === 'auto' ? makeAutoCategoryInterval(axis) : optionLabelInterval;\n labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);\n } // Cache to avoid calling interval function repeatly.\n\n\n return listCacheSet(labelsCache, optionLabelInterval, {\n labels: labels,\n labelCategoryInterval: numericLabelInterval\n });\n}\n\nfunction makeCategoryTicks(axis, tickModel) {\n var ticksCache = getListCache(axis, 'ticks');\n var optionTickInterval = getOptionCategoryInterval(tickModel);\n var result = listCacheGet(ticksCache, optionTickInterval);\n\n if (result) {\n return result;\n }\n\n var ticks;\n var tickCategoryInterval; // Optimize for the case that large category data and no label displayed,\n // we should not return all ticks.\n\n if (!tickModel.get('show') || axis.scale.isBlank()) {\n ticks = [];\n }\n\n if (zrUtil.isFunction(optionTickInterval)) {\n ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);\n } // Always use label interval by default despite label show. Consider this\n // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows\n // labels. `splitLine` and `axisTick` should be consistent in this case.\n else if (optionTickInterval === 'auto') {\n var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());\n tickCategoryInterval = labelsResult.labelCategoryInterval;\n ticks = zrUtil.map(labelsResult.labels, function (labelItem) {\n return labelItem.tickValue;\n });\n } else {\n tickCategoryInterval = optionTickInterval;\n ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);\n } // Cache to avoid calling interval function repeatly.\n\n\n return listCacheSet(ticksCache, optionTickInterval, {\n ticks: ticks,\n tickCategoryInterval: tickCategoryInterval\n });\n}\n\nfunction makeRealNumberLabels(axis) {\n var ticks = axis.scale.getTicks();\n var labelFormatter = makeLabelFormatter(axis);\n return {\n labels: zrUtil.map(ticks, function (tick, idx) {\n return {\n formattedLabel: labelFormatter(tick, idx),\n rawLabel: axis.scale.getLabel(tick),\n tickValue: tick.value\n };\n })\n };\n}\n\nfunction getListCache(axis, prop) {\n // Because key can be funciton, and cache size always be small, we use array cache.\n return inner(axis)[prop] || (inner(axis)[prop] = []);\n}\n\nfunction listCacheGet(cache, key) {\n for (var i = 0; i < cache.length; i++) {\n if (cache[i].key === key) {\n return cache[i].value;\n }\n }\n}\n\nfunction listCacheSet(cache, key, value) {\n cache.push({\n key: key,\n value: value\n });\n return value;\n}\n\nfunction makeAutoCategoryInterval(axis) {\n var result = inner(axis).autoInterval;\n return result != null ? result : inner(axis).autoInterval = axis.calculateCategoryInterval();\n}\n/**\n * Calculate interval for category axis ticks and labels.\n * To get precise result, at least one of `getRotate` and `isHorizontal`\n * should be implemented in axis.\n */\n\n\nexport function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter({\n value: tickValue\n }), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var axisExtent = axis.getExtent();\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n // The jitter will cause that sometimes the displayed labels are\n // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not\n // be used. Otherwise some hiden labels might not be shown again.\n && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n cache.axisExtent0 = axisExtent[0];\n cache.axisExtent1 = axisExtent[1];\n }\n\n return interval;\n}\n\nfunction fetchAutoCategoryIntervalCalculationParams(axis) {\n var labelModel = axis.getLabelModel();\n return {\n axisRotate: axis.getRotate ? axis.getRotate() : axis.isHorizontal && !axis.isHorizontal() ? 90 : 0,\n labelRotate: labelModel.get('rotate') || 0,\n font: labelModel.getFont()\n };\n}\n\nfunction makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {\n var labelFormatter = makeLabelFormatter(axis);\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent();\n var labelModel = axis.getLabelModel();\n var result = []; // TODO: axisType: ordinalTime, pick the tick from each month/day/year/...\n\n var step = Math.max((categoryInterval || 0) + 1, 1);\n var startTick = ordinalExtent[0];\n var tickCount = ordinalScale.count(); // Calculate start tick based on zero if possible to keep label consistent\n // while zooming and moving while interval > 0. Otherwise the selection\n // of displayable ticks and symbols probably keep changing.\n // 3 is empirical value.\n\n if (startTick !== 0 && step > 1 && tickCount / step > 2) {\n startTick = Math.round(Math.ceil(startTick / step) * step);\n } // (1) Only add min max label here but leave overlap checking\n // to render stage, which also ensure the returned list\n // suitable for splitLine and splitArea rendering.\n // (2) Scales except category always contain min max label so\n // do not need to perform this process.\n\n\n var showAllLabel = shouldShowAllLabels(axis);\n var includeMinLabel = labelModel.get('showMinLabel') || showAllLabel;\n var includeMaxLabel = labelModel.get('showMaxLabel') || showAllLabel;\n\n if (includeMinLabel && startTick !== ordinalExtent[0]) {\n addItem(ordinalExtent[0]);\n } // Optimize: avoid generating large array by `ordinalScale.getTicks()`.\n\n\n var tickValue = startTick;\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n addItem(tickValue);\n }\n\n if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {\n addItem(ordinalExtent[1]);\n }\n\n function addItem(tickValue) {\n var tickObj = {\n value: tickValue\n };\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickObj),\n rawLabel: ordinalScale.getLabel(tickObj),\n tickValue: tickValue\n });\n }\n\n return result;\n}\n\nfunction makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {\n var ordinalScale = axis.scale;\n var labelFormatter = makeLabelFormatter(axis);\n var result = [];\n zrUtil.each(ordinalScale.getTicks(), function (tick) {\n var rawLabel = ordinalScale.getLabel(tick);\n var tickValue = tick.value;\n\n if (categoryInterval(tick.value, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tick),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, map } from 'zrender/lib/core/util';\nimport { linearMap, getPixelPrecision, round } from '../util/number';\nimport { createAxisTicks, createAxisLabels, calculateCategoryInterval } from './axisTickLabelBuilder';\nvar NORMALIZED_EXTENT = [0, 1];\n/**\n * Base class of Axis.\n */\n\nvar Axis =\n/** @class */\nfunction () {\n function Axis(dim, scale, extent) {\n this.onBand = false;\n this.inverse = false;\n this.dim = dim;\n this.scale = scale;\n this._extent = extent || [0, 0];\n }\n /**\n * If axis extent contain given coord\n */\n\n\n Axis.prototype.contain = function (coord) {\n var extent = this._extent;\n var min = Math.min(extent[0], extent[1]);\n var max = Math.max(extent[0], extent[1]);\n return coord >= min && coord <= max;\n };\n /**\n * If axis extent contain given data\n */\n\n\n Axis.prototype.containData = function (data) {\n return this.scale.contain(data);\n };\n /**\n * Get coord extent.\n */\n\n\n Axis.prototype.getExtent = function () {\n return this._extent.slice();\n };\n /**\n * Get precision used for formatting\n */\n\n\n Axis.prototype.getPixelPrecision = function (dataExtent) {\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\n };\n /**\n * Set coord extent\n */\n\n\n Axis.prototype.setExtent = function (start, end) {\n var extent = this._extent;\n extent[0] = start;\n extent[1] = end;\n };\n /**\n * Convert data to coord. Data is the rank if it has an ordinal scale\n */\n\n\n Axis.prototype.dataToCoord = function (data, clamp) {\n var extent = this._extent;\n var scale = this.scale;\n data = scale.normalize(data);\n\n if (this.onBand && scale.type === 'ordinal') {\n extent = extent.slice();\n fixExtentWithBands(extent, scale.count());\n }\n\n return linearMap(data, NORMALIZED_EXTENT, extent, clamp);\n };\n /**\n * Convert coord to data. Data is the rank if it has an ordinal scale\n */\n\n\n Axis.prototype.coordToData = function (coord, clamp) {\n var extent = this._extent;\n var scale = this.scale;\n\n if (this.onBand && scale.type === 'ordinal') {\n extent = extent.slice();\n fixExtentWithBands(extent, scale.count());\n }\n\n var t = linearMap(coord, extent, NORMALIZED_EXTENT, clamp);\n return this.scale.scale(t);\n };\n /**\n * Convert pixel point to data in axis\n */\n\n\n Axis.prototype.pointToData = function (point, clamp) {\n // Should be implemented in derived class if necessary.\n return;\n };\n /**\n * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`,\n * `axis.getTicksCoords` considers `onBand`, which is used by\n * `boundaryGap:true` of category axis and splitLine and splitArea.\n * @param opt.tickModel default: axis.model.getModel('axisTick')\n * @param opt.clamp If `true`, the first and the last\n * tick must be at the axis end points. Otherwise, clip ticks\n * that outside the axis extent.\n */\n\n\n Axis.prototype.getTicksCoords = function (opt) {\n opt = opt || {};\n var tickModel = opt.tickModel || this.getTickModel();\n var result = createAxisTicks(this, tickModel);\n var ticks = result.ticks;\n var ticksCoords = map(ticks, function (tickVal) {\n return {\n coord: this.dataToCoord(this.scale.type === 'ordinal' ? this.scale.getRawOrdinalNumber(tickVal) : tickVal),\n tickValue: tickVal\n };\n }, this);\n var alignWithLabel = tickModel.get('alignWithLabel');\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\n return ticksCoords;\n };\n\n Axis.prototype.getMinorTicksCoords = function () {\n if (this.scale.type === 'ordinal') {\n // Category axis doesn't support minor ticks\n return [];\n }\n\n var minorTickModel = this.model.getModel('minorTick');\n var splitNumber = minorTickModel.get('splitNumber'); // Protection.\n\n if (!(splitNumber > 0 && splitNumber < 100)) {\n splitNumber = 5;\n }\n\n var minorTicks = this.scale.getMinorTicks(splitNumber);\n var minorTicksCoords = map(minorTicks, function (minorTicksGroup) {\n return map(minorTicksGroup, function (minorTick) {\n return {\n coord: this.dataToCoord(minorTick),\n tickValue: minorTick\n };\n }, this);\n }, this);\n return minorTicksCoords;\n };\n\n Axis.prototype.getViewLabels = function () {\n return createAxisLabels(this).labels;\n };\n\n Axis.prototype.getLabelModel = function () {\n return this.model.getModel('axisLabel');\n };\n /**\n * Notice here we only get the default tick model. For splitLine\n * or splitArea, we should pass the splitLineModel or splitAreaModel\n * manually when calling `getTicksCoords`.\n * In GL, this method may be overrided to:\n * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));`\n */\n\n\n Axis.prototype.getTickModel = function () {\n return this.model.getModel('axisTick');\n };\n /**\n * Get width of band\n */\n\n\n Axis.prototype.getBandWidth = function () {\n var axisExtent = this._extent;\n var dataExtent = this.scale.getExtent();\n var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0); // Fix #2728, avoid NaN when only one data.\n\n len === 0 && (len = 1);\n var size = Math.abs(axisExtent[1] - axisExtent[0]);\n return Math.abs(size) / len;\n };\n /**\n * Only be called in category axis.\n * Can be overrided, consider other axes like in 3D.\n * @return Auto interval for cateogry axis tick and label\n */\n\n\n Axis.prototype.calculateCategoryInterval = function () {\n return calculateCategoryInterval(this);\n };\n\n return Axis;\n}();\n\nfunction fixExtentWithBands(extent, nTick) {\n var size = extent[1] - extent[0];\n var len = nTick;\n var margin = size / len / 2;\n extent[0] += margin;\n extent[1] -= margin;\n} // If axis has labels [1, 2, 3, 4]. Bands on the axis are\n// |---1---|---2---|---3---|---4---|.\n// So the displayed ticks and splitLine/splitArea should between\n// each data item, otherwise cause misleading (e.g., split tow bars\n// of a single data item when there are two bar series).\n// Also consider if tickCategoryInterval > 0 and onBand, ticks and\n// splitLine/spliteArea should layout appropriately corresponding\n// to displayed labels. (So we should not use `getBandWidth` in this\n// case).\n\n\nfunction fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp) {\n var ticksLen = ticksCoords.length;\n\n if (!axis.onBand || alignWithLabel || !ticksLen) {\n return;\n }\n\n var axisExtent = axis.getExtent();\n var last;\n var diffSize;\n\n if (ticksLen === 1) {\n ticksCoords[0].coord = axisExtent[0];\n last = ticksCoords[1] = {\n coord: axisExtent[0]\n };\n } else {\n var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;\n var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift_1 / 2;\n });\n var dataExtent = axis.scale.getExtent();\n diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;\n last = {\n coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize\n };\n ticksCoords.push(last);\n }\n\n var inverse = axisExtent[0] > axisExtent[1]; // Handling clamp.\n\n if (littleThan(ticksCoords[0].coord, axisExtent[0])) {\n clamp ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();\n }\n\n if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) {\n ticksCoords.unshift({\n coord: axisExtent[0]\n });\n }\n\n if (littleThan(axisExtent[1], last.coord)) {\n clamp ? last.coord = axisExtent[1] : ticksCoords.pop();\n }\n\n if (clamp && littleThan(last.coord, axisExtent[1])) {\n ticksCoords.push({\n coord: axisExtent[1]\n });\n }\n\n function littleThan(a, b) {\n // Avoid rounding error cause calculated tick coord different with extent.\n // It may cause an extra unecessary tick added.\n a = round(a);\n b = round(b);\n return inverse ? a > b : a < b;\n }\n}\n\nexport default Axis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\n return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1;\n}\n\nfunction defaultKeyGetter(item) {\n return item;\n}\n\nvar DataDiffer =\n/** @class */\nfunction () {\n /**\n * @param context Can be visited by this.context in callback.\n */\n function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context, // By default: 'oneToOne'.\n diffMode) {\n this._old = oldArr;\n this._new = newArr;\n this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;\n this._newKeyGetter = newKeyGetter || defaultKeyGetter; // Visible in callback via `this.context`;\n\n this.context = context;\n this._diffModeMultiple = diffMode === 'multiple';\n }\n /**\n * Callback function when add a data\n */\n\n\n DataDiffer.prototype.add = function (func) {\n this._add = func;\n return this;\n };\n /**\n * Callback function when update a data\n */\n\n\n DataDiffer.prototype.update = function (func) {\n this._update = func;\n return this;\n };\n /**\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\n */\n\n\n DataDiffer.prototype.updateManyToOne = function (func) {\n this._updateManyToOne = func;\n return this;\n };\n /**\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\n */\n\n\n DataDiffer.prototype.updateOneToMany = function (func) {\n this._updateOneToMany = func;\n return this;\n };\n /**\n * Callback function when update a data and only work in `cbMode: 'byKey'`.\n */\n\n\n DataDiffer.prototype.updateManyToMany = function (func) {\n this._updateManyToMany = func;\n return this;\n };\n /**\n * Callback function when remove a data\n */\n\n\n DataDiffer.prototype.remove = function (func) {\n this._remove = func;\n return this;\n };\n\n DataDiffer.prototype.execute = function () {\n this[this._diffModeMultiple ? '_executeMultiple' : '_executeOneToOne']();\n };\n\n DataDiffer.prototype._executeOneToOne = function () {\n var oldArr = this._old;\n var newArr = this._new;\n var newDataIndexMap = {};\n var oldDataKeyArr = new Array(oldArr.length);\n var newDataKeyArr = new Array(newArr.length);\n\n this._initIndexMap(oldArr, null, oldDataKeyArr, '_oldKeyGetter');\n\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n\n for (var i = 0; i < oldArr.length; i++) {\n var oldKey = oldDataKeyArr[i];\n var newIdxMapVal = newDataIndexMap[oldKey];\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal); // idx can never be empty array here. see 'set null' logic below.\n\n if (newIdxMapValLen > 1) {\n // Consider there is duplicate key (for example, use dataItem.name as key).\n // We should make sure every item in newArr and oldArr can be visited.\n var newIdx = newIdxMapVal.shift();\n\n if (newIdxMapVal.length === 1) {\n newDataIndexMap[oldKey] = newIdxMapVal[0];\n }\n\n this._update && this._update(newIdx, i);\n } else if (newIdxMapValLen === 1) {\n newDataIndexMap[oldKey] = null;\n this._update && this._update(newIdxMapVal, i);\n } else {\n this._remove && this._remove(i);\n }\n }\n\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\n };\n /**\n * For example, consider the case:\n * oldData: [o0, o1, o2, o3, o4, o5, o6, o7],\n * newData: [n0, n1, n2, n3, n4, n5, n6, n7, n8],\n * Where:\n * o0, o1, n0 has key 'a' (many to one)\n * o5, n4, n5, n6 has key 'b' (one to many)\n * o2, n1 has key 'c' (one to one)\n * n2, n3 has key 'd' (add)\n * o3, o4 has key 'e' (remove)\n * o6, o7, n7, n8 has key 'f' (many to many, treated as add and remove)\n * Then:\n * (The order of the following directives are not ensured.)\n * this._updateManyToOne(n0, [o0, o1]);\n * this._updateOneToMany([n4, n5, n6], o5);\n * this._update(n1, o2);\n * this._remove(o3);\n * this._remove(o4);\n * this._remove(o6);\n * this._remove(o7);\n * this._add(n2);\n * this._add(n3);\n * this._add(n7);\n * this._add(n8);\n */\n\n\n DataDiffer.prototype._executeMultiple = function () {\n var oldArr = this._old;\n var newArr = this._new;\n var oldDataIndexMap = {};\n var newDataIndexMap = {};\n var oldDataKeyArr = [];\n var newDataKeyArr = [];\n\n this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter');\n\n this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter');\n\n for (var i = 0; i < oldDataKeyArr.length; i++) {\n var oldKey = oldDataKeyArr[i];\n var oldIdxMapVal = oldDataIndexMap[oldKey];\n var newIdxMapVal = newDataIndexMap[oldKey];\n var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);\n var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n\n if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {\n this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {\n this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {\n this._update && this._update(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen > 1 && newIdxMapValLen > 1) {\n this._updateManyToMany && this._updateManyToMany(newIdxMapVal, oldIdxMapVal);\n newDataIndexMap[oldKey] = null;\n } else if (oldIdxMapValLen > 1) {\n for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {\n this._remove && this._remove(oldIdxMapVal[i_1]);\n }\n } else {\n this._remove && this._remove(oldIdxMapVal);\n }\n }\n\n this._performRestAdd(newDataKeyArr, newDataIndexMap);\n };\n\n DataDiffer.prototype._performRestAdd = function (newDataKeyArr, newDataIndexMap) {\n for (var i = 0; i < newDataKeyArr.length; i++) {\n var newKey = newDataKeyArr[i];\n var newIdxMapVal = newDataIndexMap[newKey];\n var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);\n\n if (idxMapValLen > 1) {\n for (var j = 0; j < idxMapValLen; j++) {\n this._add && this._add(newIdxMapVal[j]);\n }\n } else if (idxMapValLen === 1) {\n this._add && this._add(newIdxMapVal);\n } // Support both `newDataKeyArr` are duplication removed or not removed.\n\n\n newDataIndexMap[newKey] = null;\n }\n };\n\n DataDiffer.prototype._initIndexMap = function (arr, // Can be null.\n map, // In 'byKey', the output `keyArr` is duplication removed.\n // In 'byIndex', the output `keyArr` is not duplication removed and\n // its indices are accurately corresponding to `arr`.\n keyArr, keyGetterName) {\n var cbModeMultiple = this._diffModeMultiple;\n\n for (var i = 0; i < arr.length; i++) {\n // Add prefix to avoid conflict with Object.prototype.\n var key = '_ec_' + this[keyGetterName](arr[i], i);\n\n if (!cbModeMultiple) {\n keyArr[i] = key;\n }\n\n if (!map) {\n continue;\n }\n\n var idxMapVal = map[key];\n var idxMapValLen = dataIndexMapValueLength(idxMapVal);\n\n if (idxMapValLen === 0) {\n // Simple optimize: in most cases, one index has one key,\n // do not need array.\n map[key] = i;\n\n if (cbModeMultiple) {\n keyArr.push(key);\n }\n } else if (idxMapValLen === 1) {\n map[key] = [idxMapVal, i];\n } else {\n idxMapVal.push(i);\n }\n }\n };\n\n return DataDiffer;\n}();\n\nexport default DataDiffer;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { parseSVG, makeViewBoxTransform } from 'zrender/lib/tool/parseSVG';\nimport Group from 'zrender/lib/graphic/Group';\nimport Rect from 'zrender/lib/graphic/shape/Rect';\nimport { assert, createHashMap, each } from 'zrender/lib/core/util';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport { parseXML } from 'zrender/lib/tool/parseXML';\nimport { GeoSVGRegion } from './Region';\n/**\n * \"region available\" means that: enable users to set attribute `name=\"xxx\"` on those tags\n * to make it be a region.\n * 1. region styles and its label styles can be defined in echarts opton:\n * ```js\n * geo: {\n * regions: [{\n * name: 'xxx',\n * itemStyle: { ... },\n * label: { ... }\n * }, {\n * ...\n * },\n * ...]\n * };\n * ```\n * 2. name can be duplicated in different SVG tag. All of the tags with the same name share\n * a region option. For exampel if there are two representing two lung lobes. They have\n * no common parents but both of them need to display label \"lung\" inside.\n */\n\nvar REGION_AVAILABLE_SVG_TAG_MAP = createHashMap(['rect', 'circle', 'line', 'ellipse', 'polygon', 'polyline', 'path', // are also enabled becuase some SVG might paint text itself,\n// but still need to trigger events or tooltip.\n'text', 'tspan', // is also enabled because this case: if multiple tags share one name\n// and need label displayed, every tags will display the name, which is not\n// expected. So we can put them into a . Thereby only one label\n// displayed and located based on the bounding rect of the .\n'g']);\n\nvar GeoSVGResource =\n/** @class */\nfunction () {\n function GeoSVGResource(mapName, svg) {\n this.type = 'geoSVG'; // All used graphics. key: hostKey, value: root\n\n this._usedGraphicMap = createHashMap(); // All unused graphics.\n\n this._freedGraphics = [];\n this._mapName = mapName; // Only perform parse to XML object here, which might be time\n // consiming for large SVG.\n // Although convert XML to zrender element is also time consiming,\n // if we do it here, the clone of zrender elements has to be\n // required. So we do it once for each geo instance, util real\n // performance issues call for optimizing it.\n\n this._parsedXML = parseXML(svg);\n }\n\n GeoSVGResource.prototype.load = function ()\n /* nameMap: NameMap */\n {\n // In the \"load\" stage, graphic need to be built to\n // get boundingRect for geo coordinate system.\n var firstGraphic = this._firstGraphic; // Create the return data structure only when first graphic created.\n // Because they will be used in geo coordinate system update stage,\n // and `regions` will be mounted at `geo` coordinate system,\n // in which there is no \"view\" info, so that it should better not to\n // make references to graphic elements.\n\n if (!firstGraphic) {\n firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML);\n\n this._freedGraphics.push(firstGraphic);\n\n this._boundingRect = this._firstGraphic.boundingRect.clone(); // PENDING: `nameMap` will not be supported until some real requirement come.\n // if (nameMap) {\n // named = applyNameMap(named, nameMap);\n // }\n\n var _a = createRegions(firstGraphic.named),\n regions = _a.regions,\n regionsMap = _a.regionsMap;\n\n this._regions = regions;\n this._regionsMap = regionsMap;\n }\n\n return {\n boundingRect: this._boundingRect,\n regions: this._regions,\n regionsMap: this._regionsMap\n };\n };\n\n GeoSVGResource.prototype._buildGraphic = function (svgXML) {\n var result;\n var rootFromParse;\n\n try {\n result = svgXML && parseSVG(svgXML, {\n ignoreViewBox: true,\n ignoreRootClip: true\n }) || {};\n rootFromParse = result.root;\n assert(rootFromParse != null);\n } catch (e) {\n throw new Error('Invalid svg format\\n' + e.message);\n } // Note: we keep the covenant that the root has no transform. So always add an extra root.\n\n\n var root = new Group();\n root.add(rootFromParse);\n root.isGeoSVGGraphicRoot = true; // [THE_RULE_OF_VIEWPORT_AND_VIEWBOX]\n //\n // Consider: ``\n // - the `width/height` we call it `svgWidth/svgHeight` for short.\n // - `(0, 0, svgWidth, svgHeight)` defines the viewport of the SVG, or say,\n // \"viewport boundingRect\", or `boundingRect` for short.\n // - `viewBox` defines the transform from the real content ot the viewport.\n // `viewBox` has the same unit as the content of SVG.\n // If `viewBox` exists, a transform is defined, so the unit of `svgWidth/svgHeight` become\n // different from the content of SVG. Otherwise, they are the same.\n //\n // If both `svgWidth/svgHeight/viewBox` are specified in a SVG file, the transform rule will be:\n // 0. `boundingRect` is `(0, 0, svgWidth, svgHeight)`. Set it to Geo['_rect'] (View['_rect']).\n // 1. Make a transform from `viewBox` to `boundingRect`.\n // Note: only suport `preserveAspectRatio 'xMidYMid'` here. That is, this transform will preserve\n // the aspect ratio.\n // 2. Make a transform from boundingRect to Geo['_viewRect'] (View['_viewRect'])\n // (`Geo`/`View` will do this job).\n // Note: this transform might not preserve aspect radio, which depending on how users specify\n // viewRect in echarts option (e.g., `geo.left/top/width/height` will not preserve aspect ratio,\n // but `geo.layoutCenter/layoutSize` will preserve aspect ratio).\n //\n // If `svgWidth/svgHeight` not specified, we use `viewBox` as the `boundingRect` to make the SVG\n // layout look good.\n //\n // If neither `svgWidth/svgHeight` nor `viewBox` are not specified, we calculate the boundingRect\n // of the SVG content and use them to make SVG layout look good.\n\n var svgWidth = result.width;\n var svgHeight = result.height;\n var viewBoxRect = result.viewBoxRect;\n var boundingRect = this._boundingRect;\n\n if (!boundingRect) {\n var bRectX = void 0;\n var bRectY = void 0;\n var bRectWidth = void 0;\n var bRectHeight = void 0;\n\n if (svgWidth != null) {\n bRectX = 0;\n bRectWidth = svgWidth;\n } else if (viewBoxRect) {\n bRectX = viewBoxRect.x;\n bRectWidth = viewBoxRect.width;\n }\n\n if (svgHeight != null) {\n bRectY = 0;\n bRectHeight = svgHeight;\n } else if (viewBoxRect) {\n bRectY = viewBoxRect.y;\n bRectHeight = viewBoxRect.height;\n } // If both viewBox and svgWidth/svgHeight not specified,\n // we have to determine how to layout those element to make them look good.\n\n\n if (bRectX == null || bRectY == null) {\n var calculatedBoundingRect = rootFromParse.getBoundingRect();\n\n if (bRectX == null) {\n bRectX = calculatedBoundingRect.x;\n bRectWidth = calculatedBoundingRect.width;\n }\n\n if (bRectY == null) {\n bRectY = calculatedBoundingRect.y;\n bRectHeight = calculatedBoundingRect.height;\n }\n }\n\n boundingRect = this._boundingRect = new BoundingRect(bRectX, bRectY, bRectWidth, bRectHeight);\n }\n\n if (viewBoxRect) {\n var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect); // Only support `preserveAspectRatio 'xMidYMid'`\n\n rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale;\n rootFromParse.x = viewBoxTransform.x;\n rootFromParse.y = viewBoxTransform.y;\n } // SVG needs to clip based on `viewBox`. And some SVG files really rely on this feature.\n // They do not strictly confine all of the content inside a display rect, but deliberately\n // use a `viewBox` to define a displayable rect.\n // PENDING:\n // The drawback of the `setClipPath` here is: the region label (genereted by echarts) near the\n // edge might also be clipped, because region labels are put as `textContent` of the SVG path.\n\n\n root.setClipPath(new Rect({\n shape: boundingRect.plain()\n }));\n var named = [];\n each(result.named, function (namedItem) {\n if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) {\n named.push(namedItem);\n setSilent(namedItem.el);\n }\n });\n return {\n root: root,\n boundingRect: boundingRect,\n named: named\n };\n };\n /**\n * Consider:\n * (1) One graphic element can not be shared by different `geoView` running simultaneously.\n * Notice, also need to consider multiple echarts instances share a `mapRecord`.\n * (2) Converting SVG to graphic elements is time consuming.\n * (3) In the current architecture, `load` should be called frequently to get boundingRect,\n * and it is called without view info.\n * So we maintain graphic elements in this module, and enables `view` to use/return these\n * graphics from/to the pool with it's uid.\n */\n\n\n GeoSVGResource.prototype.useGraphic = function (hostKey\n /*, nameMap: NameMap */\n ) {\n var usedRootMap = this._usedGraphicMap;\n var svgGraphic = usedRootMap.get(hostKey);\n\n if (svgGraphic) {\n return svgGraphic;\n }\n\n svgGraphic = this._freedGraphics.pop() // use the first boundingRect to avoid duplicated boundingRect calculation.\n || this._buildGraphic(this._parsedXML);\n usedRootMap.set(hostKey, svgGraphic); // PENDING: `nameMap` will not be supported until some real requirement come.\n // `nameMap` can only be obtained from echarts option.\n // The original `named` must not be modified.\n // if (nameMap) {\n // svgGraphic = extend({}, svgGraphic);\n // svgGraphic.named = applyNameMap(svgGraphic.named, nameMap);\n // }\n\n return svgGraphic;\n };\n\n GeoSVGResource.prototype.freeGraphic = function (hostKey) {\n var usedRootMap = this._usedGraphicMap;\n var svgGraphic = usedRootMap.get(hostKey);\n\n if (svgGraphic) {\n usedRootMap.removeKey(hostKey);\n\n this._freedGraphics.push(svgGraphic);\n }\n };\n\n return GeoSVGResource;\n}();\n\nexport { GeoSVGResource };\n\nfunction setSilent(el) {\n // Only named element has silent: false, other elements should\n // act as background and has no user interaction.\n el.silent = false; // text|tspan will be converted to group.\n\n if (el.isGroup) {\n el.traverse(function (child) {\n child.silent = false;\n });\n }\n}\n\nfunction createRegions(named) {\n var regions = [];\n var regionsMap = createHashMap(); // Create resions only for the first graphic.\n\n each(named, function (namedItem) {\n // Region has feature to calculate center for tooltip or other features.\n // If there is a , the center should be the center of the\n // bounding rect of the g.\n if (namedItem.namedFrom != null) {\n return;\n }\n\n var region = new GeoSVGRegion(namedItem.name, namedItem.el); // PENDING: if `nameMap` supported, this region can not be mounted on\n // `this`, but can only be created each time `load()` called.\n\n regions.push(region); // PENDING: if multiple tag named with the same name, only one will be\n // found by `_regionsMap`. `_regionsMap` is used to find a coordinate\n // by name. We use `region.getCenter()` as the coordinate.\n\n regionsMap.set(namedItem.name, region);\n });\n return {\n regions: regions,\n regionsMap: regionsMap\n };\n} // PENDING: `nameMap` will not be supported until some real requirement come.\n// /**\n// * Use the alias in geoNameMap.\n// * The input `named` must not be modified.\n// */\n// function applyNameMap(\n// named: GeoSVGGraphicRecord['named'],\n// nameMap: NameMap\n// ): GeoSVGGraphicRecord['named'] {\n// const result = [] as GeoSVGGraphicRecord['named'];\n// for (let i = 0; i < named.length; i++) {\n// let regionGraphic = named[i];\n// const name = regionGraphic.name;\n// if (nameMap && nameMap.hasOwnProperty(name)) {\n// regionGraphic = extend({}, regionGraphic);\n// regionGraphic.name = name;\n// }\n// result.push(regionGraphic);\n// }\n// return result;\n// }","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Fix for 南海诸岛\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { GeoJSONRegion } from '../Region';\nvar geoCoord = [126, 25];\nvar nanhaiName = '南海诸岛';\nvar points = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]];\n\nfor (var i = 0; i < points.length; i++) {\n for (var k = 0; k < points[i].length; k++) {\n points[i][k][0] /= 10.5;\n points[i][k][1] /= -10.5 / 0.75;\n points[i][k][0] += geoCoord[0];\n points[i][k][1] += geoCoord[1];\n }\n}\n\nexport default function fixNanhai(mapType, regions) {\n if (mapType === 'china') {\n for (var i = 0; i < regions.length; i++) {\n // Already exists.\n if (regions[i].name === nanhaiName) {\n return;\n }\n }\n\n regions.push(new GeoJSONRegion(nanhaiName, zrUtil.map(points, function (exterior) {\n return {\n type: 'polygon',\n exterior: exterior\n };\n }), geoCoord));\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar coordsOffsetMap = {\n '南海诸岛': [32, 80],\n // 全国\n '广东': [0, -10],\n '香港': [10, 5],\n '澳门': [-10, 10],\n //'北京': [-10, 0],\n '天津': [5, 5]\n};\nexport default function fixTextCoords(mapType, region) {\n if (mapType === 'china') {\n var coordFix = coordsOffsetMap[region.name];\n\n if (coordFix) {\n var cp = region.getCenter();\n cp[0] += coordFix[0] / 10.5;\n cp[1] += -coordFix[1] / (10.5 / 0.75);\n region.setCenter(cp);\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar geoCoordMap = {\n 'Russia': [100, 60],\n 'United States': [-99, 38],\n 'United States of America': [-99, 38]\n};\nexport default function fixGeoCoords(mapType, region) {\n if (mapType === 'world') {\n var geoCoord = geoCoordMap[region.name];\n\n if (geoCoord) {\n var cp = [geoCoord[0], geoCoord[1]];\n region.setCenter(cp);\n }\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Fix for 钓鱼岛\n// let Region = require('../Region');\n// let zrUtil = require('zrender/lib/core/util');\n// let geoCoord = [126, 25];\nvar points = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];\nexport default function fixDiaoyuIsland(mapType, region) {\n if (mapType === 'china' && region.name === '台湾') {\n region.geometries.push({\n type: 'polygon',\n exterior: points[0]\n });\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, isString, createHashMap } from 'zrender/lib/core/util';\nimport parseGeoJson from './parseGeoJson'; // Built-in GEO fixer.\n\nimport fixNanhai from './fix/nanhai';\nimport fixTextCoord from './fix/textCoord';\nimport fixGeoCoord from './fix/geoCoord';\nimport fixDiaoyuIsland from './fix/diaoyuIsland';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nvar DEFAULT_NAME_PROPERTY = 'name';\n\nvar GeoJSONResource =\n/** @class */\nfunction () {\n function GeoJSONResource(mapName, geoJSON, specialAreas) {\n this.type = 'geoJSON';\n this._parsedMap = createHashMap();\n this._mapName = mapName;\n this._specialAreas = specialAreas; // PENDING: delay the parse to the first usage to rapid up the FMP?\n\n this._geoJSON = parseInput(geoJSON);\n }\n /**\n * @param nameMap can be null/undefined\n * @param nameProperty can be null/undefined\n */\n\n\n GeoJSONResource.prototype.load = function (nameMap, nameProperty) {\n nameProperty = nameProperty || DEFAULT_NAME_PROPERTY;\n\n var parsed = this._parsedMap.get(nameProperty);\n\n if (!parsed) {\n var rawRegions = this._parseToRegions(nameProperty);\n\n parsed = this._parsedMap.set(nameProperty, {\n regions: rawRegions,\n boundingRect: calculateBoundingRect(rawRegions)\n });\n }\n\n var regionsMap = createHashMap();\n var finalRegions = [];\n each(parsed.regions, function (region) {\n var regionName = region.name; // Try use the alias in geoNameMap\n\n if (nameMap && nameMap.hasOwnProperty(regionName)) {\n region = region.cloneShallow(regionName = nameMap[regionName]);\n }\n\n finalRegions.push(region);\n regionsMap.set(regionName, region);\n });\n return {\n regions: finalRegions,\n boundingRect: parsed.boundingRect || new BoundingRect(0, 0, 0, 0),\n regionsMap: regionsMap\n };\n };\n\n GeoJSONResource.prototype._parseToRegions = function (nameProperty) {\n var mapName = this._mapName;\n var geoJSON = this._geoJSON;\n var rawRegions; // https://jsperf.com/try-catch-performance-overhead\n\n try {\n rawRegions = geoJSON ? parseGeoJson(geoJSON, nameProperty) : [];\n } catch (e) {\n throw new Error('Invalid geoJson format\\n' + e.message);\n }\n\n fixNanhai(mapName, rawRegions);\n each(rawRegions, function (region) {\n var regionName = region.name;\n fixTextCoord(mapName, region);\n fixGeoCoord(mapName, region);\n fixDiaoyuIsland(mapName, region); // Some area like Alaska in USA map needs to be tansformed\n // to look better\n\n var specialArea = this._specialAreas && this._specialAreas[regionName];\n\n if (specialArea) {\n region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height);\n }\n }, this);\n return rawRegions;\n };\n /**\n * Only for exporting to users.\n * **MUST NOT** used internally.\n */\n\n\n GeoJSONResource.prototype.getMapForUser = function () {\n return {\n // For backward compatibility, use geoJson\n // PENDING: it has been returning them without clone.\n // do we need to avoid outsite modification?\n geoJson: this._geoJSON,\n geoJSON: this._geoJSON,\n specialAreas: this._specialAreas\n };\n };\n\n return GeoJSONResource;\n}();\n\nexport { GeoJSONResource };\n\nfunction calculateBoundingRect(regions) {\n var rect;\n\n for (var i = 0; i < regions.length; i++) {\n var regionRect = regions[i].getBoundingRect();\n rect = rect || regionRect.clone();\n rect.union(regionRect);\n }\n\n return rect;\n}\n\nfunction parseInput(source) {\n return !isString(source) ? source : typeof JSON !== 'undefined' && JSON.parse ? JSON.parse(source) : new Function('return (' + source + ');')();\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap } from 'zrender/lib/core/util';\nimport { GeoSVGResource } from './GeoSVGResource';\nimport { GeoJSONResource } from './GeoJSONResource';\nvar storage = createHashMap();\nexport default {\n /**\n * Compatible with previous `echarts.registerMap`.\n *\n * @usage\n * ```js\n *\n * echarts.registerMap('USA', geoJson, specialAreas);\n *\n * echarts.registerMap('USA', {\n * geoJson: geoJson,\n * specialAreas: {...}\n * });\n * echarts.registerMap('USA', {\n * geoJSON: geoJson,\n * specialAreas: {...}\n * });\n *\n * echarts.registerMap('airport', {\n * svg: svg\n * }\n * ```\n *\n * Note:\n * Do not support that register multiple geoJSON or SVG\n * one map name. Because different geoJSON and SVG have\n * different unit. It's not easy to make sure how those\n * units are mapping/normalize.\n * If intending to use multiple geoJSON or SVG, we can\n * use multiple geo coordinate system.\n */\n registerMap: function (mapName, rawDef, rawSpecialAreas) {\n if (rawDef.svg) {\n var resource = new GeoSVGResource(mapName, rawDef.svg);\n storage.set(mapName, resource);\n } else {\n // Recommend:\n // echarts.registerMap('eu', { geoJSON: xxx, specialAreas: xxx });\n // Backward compatibility:\n // echarts.registerMap('eu', geoJSON, specialAreas);\n // echarts.registerMap('eu', { geoJson: xxx, specialAreas: xxx });\n var geoJSON = rawDef.geoJson || rawDef.geoJSON;\n\n if (geoJSON && !rawDef.features) {\n rawSpecialAreas = rawDef.specialAreas;\n } else {\n geoJSON = rawDef;\n }\n\n var resource = new GeoJSONResource(mapName, geoJSON, rawSpecialAreas);\n storage.set(mapName, resource);\n }\n },\n getGeoResource: function (mapName) {\n return storage.get(mapName);\n },\n\n /**\n * Only for exporting to users.\n * **MUST NOT** used internally.\n */\n getMapForUser: function (mapName) {\n var resource = storage.get(mapName); // Do not support return SVG until some real requirement come.\n\n return resource && resource.type === 'geoJSON' && resource.getMapForUser();\n },\n load: function (mapName, nameMap, nameProperty) {\n var resource = storage.get(mapName);\n\n if (!resource) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Map ' + mapName + ' not exists. The GeoJSON of the map must be provided.');\n }\n\n return;\n }\n\n return resource.load(nameMap, nameProperty);\n }\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport function isCoordinateSystemType(coordSys, type) {\n return coordSys.type === type;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nvar AxisModelCommonMixin =\n/** @class */\nfunction () {\n function AxisModelCommonMixin() {}\n\n AxisModelCommonMixin.prototype.getNeedCrossZero = function () {\n var option = this.option;\n return !option.scale;\n };\n /**\n * Should be implemented by each axis model if necessary.\n * @return coordinate system model\n */\n\n\n AxisModelCommonMixin.prototype.getCoordSysModel = function () {\n return;\n };\n\n return AxisModelCommonMixin;\n}();\n\nexport { AxisModelCommonMixin };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nvar coordinateSystemCreators = {};\n\nvar CoordinateSystemManager =\n/** @class */\nfunction () {\n function CoordinateSystemManager() {\n this._coordinateSystems = [];\n }\n\n CoordinateSystemManager.prototype.create = function (ecModel, api) {\n var coordinateSystems = [];\n zrUtil.each(coordinateSystemCreators, function (creater, type) {\n var list = creater.create(ecModel, api);\n coordinateSystems = coordinateSystems.concat(list || []);\n });\n this._coordinateSystems = coordinateSystems;\n };\n\n CoordinateSystemManager.prototype.update = function (ecModel, api) {\n zrUtil.each(this._coordinateSystems, function (coordSys) {\n coordSys.update && coordSys.update(ecModel, api);\n });\n };\n\n CoordinateSystemManager.prototype.getCoordinateSystems = function () {\n return this._coordinateSystems.slice();\n };\n\n CoordinateSystemManager.register = function (type, creator) {\n coordinateSystemCreators[type] = creator;\n };\n\n CoordinateSystemManager.get = function (type) {\n return coordinateSystemCreators[type];\n };\n\n return CoordinateSystemManager;\n}();\n\nexport default CoordinateSystemManager;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\n/**\n * Simple view coordinate system\n * Mapping given x, y to transformd view x, y\n */\n\nimport * as vector from 'zrender/lib/core/vector';\nimport * as matrix from 'zrender/lib/core/matrix';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport Transformable from 'zrender/lib/core/Transformable';\nvar v2ApplyTransform = vector.applyTransform;\n\nvar View =\n/** @class */\nfunction (_super) {\n __extends(View, _super);\n\n function View(name) {\n var _this = _super.call(this) || this;\n\n _this.type = 'view';\n _this.dimensions = ['x', 'y'];\n /**\n * Represents the transform brought by roam/zoom.\n * If `View['_viewRect']` applies roam transform,\n * we can get the final displayed rect.\n */\n\n _this._roamTransformable = new Transformable();\n /**\n * Represents the transform from `View['_rect']` to `View['_viewRect']`.\n */\n\n _this._rawTransformable = new Transformable();\n _this.name = name;\n return _this;\n }\n\n View.prototype.setBoundingRect = function (x, y, width, height) {\n this._rect = new BoundingRect(x, y, width, height);\n return this._rect;\n };\n /**\n * @return {module:zrender/core/BoundingRect}\n */\n\n\n View.prototype.getBoundingRect = function () {\n return this._rect;\n };\n\n View.prototype.setViewRect = function (x, y, width, height) {\n this._transformTo(x, y, width, height);\n\n this._viewRect = new BoundingRect(x, y, width, height);\n };\n /**\n * Transformed to particular position and size\n */\n\n\n View.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var rawTransform = this._rawTransformable;\n rawTransform.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransform.parent;\n rawTransform.parent = null;\n rawTransform.decomposeTransform();\n rawTransform.parent = rawParent;\n\n this._updateTransform();\n };\n /**\n * Set center of view\n */\n\n\n View.prototype.setCenter = function (centerCoord) {\n if (!centerCoord) {\n return;\n }\n\n this._center = centerCoord;\n\n this._updateCenterAndZoom();\n };\n\n View.prototype.setZoom = function (zoom) {\n zoom = zoom || 1;\n var zoomLimit = this.zoomLimit;\n\n if (zoomLimit) {\n if (zoomLimit.max != null) {\n zoom = Math.min(zoomLimit.max, zoom);\n }\n\n if (zoomLimit.min != null) {\n zoom = Math.max(zoomLimit.min, zoom);\n }\n }\n\n this._zoom = zoom;\n\n this._updateCenterAndZoom();\n };\n /**\n * Get default center without roam\n */\n\n\n View.prototype.getDefaultCenter = function () {\n // Rect before any transform\n var rawRect = this.getBoundingRect();\n var cx = rawRect.x + rawRect.width / 2;\n var cy = rawRect.y + rawRect.height / 2;\n return [cx, cy];\n };\n\n View.prototype.getCenter = function () {\n return this._center || this.getDefaultCenter();\n };\n\n View.prototype.getZoom = function () {\n return this._zoom || 1;\n };\n\n View.prototype.getRoamTransform = function () {\n return this._roamTransformable.getLocalTransform();\n };\n /**\n * Remove roam\n */\n\n\n View.prototype._updateCenterAndZoom = function () {\n // Must update after view transform updated\n var rawTransformMatrix = this._rawTransformable.getLocalTransform();\n\n var roamTransform = this._roamTransformable;\n var defaultCenter = this.getDefaultCenter();\n var center = this.getCenter();\n var zoom = this.getZoom();\n center = vector.applyTransform([], center, rawTransformMatrix);\n defaultCenter = vector.applyTransform([], defaultCenter, rawTransformMatrix);\n roamTransform.originX = center[0];\n roamTransform.originY = center[1];\n roamTransform.x = defaultCenter[0] - center[0];\n roamTransform.y = defaultCenter[1] - center[1];\n roamTransform.scaleX = roamTransform.scaleY = zoom;\n\n this._updateTransform();\n };\n /**\n * Update transform props on `this` based on the current\n * `this._roamTransformable` and `this._rawTransformable`.\n */\n\n\n View.prototype._updateTransform = function () {\n var roamTransformable = this._roamTransformable;\n var rawTransformable = this._rawTransformable;\n rawTransformable.parent = roamTransformable;\n roamTransformable.updateTransform();\n rawTransformable.updateTransform();\n matrix.copy(this.transform || (this.transform = []), rawTransformable.transform || matrix.create());\n this._rawTransform = rawTransformable.getLocalTransform();\n this.invTransform = this.invTransform || [];\n matrix.invert(this.invTransform, this.transform);\n this.decomposeTransform();\n };\n\n View.prototype.getTransformInfo = function () {\n var rawTransformable = this._rawTransformable;\n var roamTransformable = this._roamTransformable; // Becuase roamTransformabel has `originX/originY` modified,\n // but the caller of `getTransformInfo` can not handle `originX/originY`,\n // so need to recalcualte them.\n\n var dummyTransformable = new Transformable();\n dummyTransformable.transform = roamTransformable.transform;\n dummyTransformable.decomposeTransform();\n return {\n roam: {\n x: dummyTransformable.x,\n y: dummyTransformable.y,\n scaleX: dummyTransformable.scaleX,\n scaleY: dummyTransformable.scaleY\n },\n raw: {\n x: rawTransformable.x,\n y: rawTransformable.y,\n scaleX: rawTransformable.scaleX,\n scaleY: rawTransformable.scaleY\n }\n };\n };\n\n View.prototype.getViewRect = function () {\n return this._viewRect;\n };\n /**\n * Get view rect after roam transform\n */\n\n\n View.prototype.getViewRectAfterRoam = function () {\n var rect = this.getBoundingRect().clone();\n rect.applyTransform(this.transform);\n return rect;\n };\n /**\n * Convert a single (lon, lat) data item to (x, y) point.\n */\n\n\n View.prototype.dataToPoint = function (data, noRoam, out) {\n var transform = noRoam ? this._rawTransform : this.transform;\n out = out || [];\n return transform ? v2ApplyTransform(out, data, transform) : vector.copy(out, data);\n };\n /**\n * Convert a (x, y) point to (lon, lat) data\n */\n\n\n View.prototype.pointToData = function (point) {\n var invTransform = this.invTransform;\n return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]];\n };\n\n View.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n View.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n /**\n * @implements\n */\n\n\n View.prototype.containPoint = function (point) {\n return this.getViewRectAfterRoam().contain(point[0], point[1]);\n };\n\n View.dimensions = ['x', 'y'];\n return View;\n}(Transformable);\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n return seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph.\n}\n\nexport default View;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport var AXIS_TYPES = {\n value: 1,\n category: 1,\n time: 1,\n log: 1\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport axisDefault from './axisDefault';\nimport { getLayoutParams, mergeLayoutParam, fetchLayoutMode } from '../util/layout';\nimport OrdinalMeta from '../data/OrdinalMeta';\nimport { AXIS_TYPES } from './axisCommonTypes';\nimport { each, merge } from 'zrender/lib/core/util';\n/**\n * Generate sub axis model class\n * @param axisName 'x' 'y' 'radius' 'angle' 'parallel' ...\n */\n\nexport default function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {\n each(AXIS_TYPES, function (v, axisType) {\n var defaultOption = merge(merge({}, axisDefault[axisType], true), extraDefaultOption, true);\n\n var AxisModel =\n /** @class */\n function (_super) {\n __extends(AxisModel, _super);\n\n function AxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = axisName + 'Axis.' + axisType;\n return _this;\n }\n\n AxisModel.prototype.mergeDefaultAndTheme = function (option, ecModel) {\n var layoutMode = fetchLayoutMode(this);\n var inputPositionParams = layoutMode ? getLayoutParams(option) : {};\n var themeModel = ecModel.getTheme();\n merge(option, themeModel.get(axisType + 'Axis'));\n merge(option, this.getDefaultOption());\n option.type = getAxisType(option);\n\n if (layoutMode) {\n mergeLayoutParam(option, inputPositionParams, layoutMode);\n }\n };\n\n AxisModel.prototype.optionUpdated = function () {\n var thisOption = this.option;\n\n if (thisOption.type === 'category') {\n this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);\n }\n };\n /**\n * Should not be called before all of 'getInitailData' finished.\n * Because categories are collected during initializing data.\n */\n\n\n AxisModel.prototype.getCategories = function (rawData) {\n var option = this.option; // FIXME\n // warning if called before all of 'getInitailData' finished.\n\n if (option.type === 'category') {\n if (rawData) {\n return option.data;\n }\n\n return this.__ordinalMeta.categories;\n }\n };\n\n AxisModel.prototype.getOrdinalMeta = function () {\n return this.__ordinalMeta;\n };\n\n AxisModel.type = axisName + 'Axis.' + axisType;\n AxisModel.defaultOption = defaultOption;\n return AxisModel;\n }(BaseAxisModelClass);\n\n registers.registerComponentModel(AxisModel);\n });\n registers.registerSubTypeDefaulter(axisName + 'Axis', getAxisType);\n}\n\nfunction getAxisType(option) {\n // Default axis with data is category axis\n return option.type || (option.data ? 'category' : 'value');\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { SINGLE_REFERRING } from '../../util/model';\n/**\n * Can only be called after coordinate system creation stage.\n * (Can be called before coordinate system update stage).\n */\n\nexport function layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n } // Axis position\n\n\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n } // Special label rotation\n\n\n var labelRotate = axisModel.get(['axisLabel', 'rotate']);\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\n layout.z2 = 1;\n return layout;\n}\nexport function isCartesian2DSeries(seriesModel) {\n return seriesModel.get('coordinateSystem') === 'cartesian2d';\n}\nexport function findAxisModels(seriesModel) {\n var axisModelMap = {\n xAxisModel: null,\n yAxisModel: null\n };\n zrUtil.each(axisModelMap, function (v, key) {\n var axisType = key.replace(/Model$/, '');\n var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!axisModel) {\n throw new Error(axisType + ' \"' + zrUtil.retrieve3(seriesModel.get(axisType + 'Index'), seriesModel.get(axisType + 'Id'), 0) + '\" not found');\n }\n }\n\n axisModelMap[key] = axisModel;\n });\n return axisModelMap;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Model from '../model/Model';\nimport env from 'zrender/lib/core/env'; // default import ZH and EN lang\n\nimport langEN from '../i18n/langEN';\nimport langZH from '../i18n/langZH';\nimport { isString, clone, merge } from 'zrender/lib/core/util';\nvar LOCALE_ZH = 'ZH';\nvar LOCALE_EN = 'EN';\nvar DEFAULT_LOCALE = LOCALE_EN;\nvar localeStorage = {};\nvar localeModels = {};\nexport var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : function () {\n var langStr = (\n /* eslint-disable-next-line */\n document.documentElement.lang || navigator.language || navigator.browserLanguage).toUpperCase();\n return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;\n}();\nexport function registerLocale(locale, localeObj) {\n locale = locale.toUpperCase();\n localeModels[locale] = new Model(localeObj);\n localeStorage[locale] = localeObj;\n} // export function getLocale(locale: string) {\n// return localeStorage[locale];\n// }\n\nexport function createLocaleObject(locale) {\n if (isString(locale)) {\n var localeObj = localeStorage[locale.toUpperCase()] || {};\n\n if (locale === LOCALE_ZH || locale === LOCALE_EN) {\n return clone(localeObj);\n } else {\n return merge(clone(localeObj), clone(localeStorage[DEFAULT_LOCALE]), false);\n }\n } else {\n return merge(clone(locale), clone(localeStorage[DEFAULT_LOCALE]), false);\n }\n}\nexport function getLocaleModel(lang) {\n return localeModels[lang];\n}\nexport function getDefaultLocaleModel() {\n return localeModels[DEFAULT_LOCALE];\n} // Default locale\n\nregisterLocale(LOCALE_EN, langEN);\nregisterLocale(LOCALE_ZH, langZH);","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { assert, isArray } from 'zrender/lib/core/util';\n;\n/**\n * @param {Object} define\n * @return See the return of `createTask`.\n */\n\nexport function createTask(define) {\n return new Task(define);\n}\n\nvar Task =\n/** @class */\nfunction () {\n function Task(define) {\n define = define || {};\n this._reset = define.reset;\n this._plan = define.plan;\n this._count = define.count;\n this._onDirty = define.onDirty;\n this._dirty = true;\n }\n /**\n * @param step Specified step.\n * @param skip Skip customer perform call.\n * @param modBy Sampling window size.\n * @param modDataCount Sampling count.\n * @return whether unfinished.\n */\n\n\n Task.prototype.perform = function (performArgs) {\n var upTask = this._upstream;\n var skip = performArgs && performArgs.skip; // TODO some refactor.\n // Pull data. Must pull data each time, because context.data\n // may be updated by Series.setData.\n\n if (this._dirty && upTask) {\n var context = this.context;\n context.data = context.outputData = upTask.context.outputData;\n }\n\n if (this.__pipeline) {\n this.__pipeline.currentTask = this;\n }\n\n var planResult;\n\n if (this._plan && !skip) {\n planResult = this._plan(this.context);\n } // Support sharding by mod, which changes the render sequence and makes the rendered graphic\n // elements uniformed distributed when progress, especially when moving or zooming.\n\n\n var lastModBy = normalizeModBy(this._modBy);\n var lastModDataCount = this._modDataCount || 0;\n var modBy = normalizeModBy(performArgs && performArgs.modBy);\n var modDataCount = performArgs && performArgs.modDataCount || 0;\n\n if (lastModBy !== modBy || lastModDataCount !== modDataCount) {\n planResult = 'reset';\n }\n\n function normalizeModBy(val) {\n !(val >= 1) && (val = 1); // jshint ignore:line\n\n return val;\n }\n\n var forceFirstProgress;\n\n if (this._dirty || planResult === 'reset') {\n this._dirty = false;\n forceFirstProgress = this._doReset(skip);\n }\n\n this._modBy = modBy;\n this._modDataCount = modDataCount;\n var step = performArgs && performArgs.step;\n\n if (upTask) {\n if (process.env.NODE_ENV !== 'production') {\n assert(upTask._outputDueEnd != null);\n }\n\n this._dueEnd = upTask._outputDueEnd;\n } // DataTask or overallTask\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this._progress || this._count);\n }\n\n this._dueEnd = this._count ? this._count(this.context) : Infinity;\n } // Note: Stubs, that its host overall task let it has progress, has progress.\n // If no progress, pass index from upstream to downstream each time plan called.\n\n\n if (this._progress) {\n var start = this._dueIndex;\n var end = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);\n\n if (!skip && (forceFirstProgress || start < end)) {\n var progress = this._progress;\n\n if (isArray(progress)) {\n for (var i = 0; i < progress.length; i++) {\n this._doProgress(progress[i], start, end, modBy, modDataCount);\n }\n } else {\n this._doProgress(progress, start, end, modBy, modDataCount);\n }\n }\n\n this._dueIndex = end; // If no `outputDueEnd`, assume that output data and\n // input data is the same, so use `dueIndex` as `outputDueEnd`.\n\n var outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end;\n\n if (process.env.NODE_ENV !== 'production') {\n // ??? Can not rollback.\n assert(outputDueEnd >= this._outputDueEnd);\n }\n\n this._outputDueEnd = outputDueEnd;\n } else {\n // (1) Some overall task has no progress.\n // (2) Stubs, that its host overall task do not let it has progress, has no progress.\n // This should always be performed so it can be passed to downstream.\n this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd;\n }\n\n return this.unfinished();\n };\n\n Task.prototype.dirty = function () {\n this._dirty = true;\n this._onDirty && this._onDirty(this.context);\n };\n\n Task.prototype._doProgress = function (progress, start, end, modBy, modDataCount) {\n iterator.reset(start, end, modBy, modDataCount);\n this._callingProgress = progress;\n\n this._callingProgress({\n start: start,\n end: end,\n count: end - start,\n next: iterator.next\n }, this.context);\n };\n\n Task.prototype._doReset = function (skip) {\n this._dueIndex = this._outputDueEnd = this._dueEnd = 0;\n this._settedOutputEnd = null;\n var progress;\n var forceFirstProgress;\n\n if (!skip && this._reset) {\n progress = this._reset(this.context);\n\n if (progress && progress.progress) {\n forceFirstProgress = progress.forceFirstProgress;\n progress = progress.progress;\n } // To simplify no progress checking, array must has item.\n\n\n if (isArray(progress) && !progress.length) {\n progress = null;\n }\n }\n\n this._progress = progress;\n this._modBy = this._modDataCount = null;\n var downstream = this._downstream;\n downstream && downstream.dirty();\n return forceFirstProgress;\n };\n\n Task.prototype.unfinished = function () {\n return this._progress && this._dueIndex < this._dueEnd;\n };\n /**\n * @param downTask The downstream task.\n * @return The downstream task.\n */\n\n\n Task.prototype.pipe = function (downTask) {\n if (process.env.NODE_ENV !== 'production') {\n assert(downTask && !downTask._disposed && downTask !== this);\n } // If already downstream, do not dirty downTask.\n\n\n if (this._downstream !== downTask || this._dirty) {\n this._downstream = downTask;\n downTask._upstream = this;\n downTask.dirty();\n }\n };\n\n Task.prototype.dispose = function () {\n if (this._disposed) {\n return;\n }\n\n this._upstream && (this._upstream._downstream = null);\n this._downstream && (this._downstream._upstream = null);\n this._dirty = false;\n this._disposed = true;\n };\n\n Task.prototype.getUpstream = function () {\n return this._upstream;\n };\n\n Task.prototype.getDownstream = function () {\n return this._downstream;\n };\n\n Task.prototype.setOutputEnd = function (end) {\n // This only happend in dataTask, dataZoom, map, currently.\n // where dataZoom do not set end each time, but only set\n // when reset. So we should record the setted end, in case\n // that the stub of dataZoom perform again and earse the\n // setted end by upstream.\n this._outputDueEnd = this._settedOutputEnd = end;\n };\n\n return Task;\n}();\n\nexport { Task };\n\nvar iterator = function () {\n var end;\n var current;\n var modBy;\n var modDataCount;\n var winCount;\n var it = {\n reset: function (s, e, sStep, sCount) {\n current = s;\n end = e;\n modBy = sStep;\n modDataCount = sCount;\n winCount = Math.ceil(modDataCount / modBy);\n it.next = modBy > 1 && modDataCount > 0 ? modNext : sequentialNext;\n }\n };\n return it;\n\n function sequentialNext() {\n return current < end ? current++ : null;\n }\n\n function modNext() {\n var dataIndex = current % winCount * modBy + Math.ceil(current / winCount);\n var result = current >= end ? null : dataIndex < modDataCount ? dataIndex // If modDataCount is smaller than data.count() (consider `appendData` case),\n // Use normal linear rendering mode.\n : current;\n current++;\n return result;\n }\n}(); ///////////////////////////////////////////////////////////\n// For stream debug (Should be commented out after used!)\n// @usage: printTask(this, 'begin');\n// @usage: printTask(this, null, {someExtraProp});\n// @usage: Use `__idxInPipeline` as conditional breakpiont.\n//\n// window.printTask = function (task: any, prefix: string, extra: { [key: string]: unknown }): void {\n// window.ecTaskUID == null && (window.ecTaskUID = 0);\n// task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`);\n// task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`);\n// let props = [];\n// if (task.__pipeline) {\n// let val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`;\n// props.push({text: '__idxInPipeline/total', value: val});\n// } else {\n// let stubCount = 0;\n// task.agentStubMap.each(() => stubCount++);\n// props.push({text: 'idx', value: `overall (stubs: ${stubCount})`});\n// }\n// props.push({text: 'uid', value: task.uidDebug});\n// if (task.__pipeline) {\n// props.push({text: 'pipelineId', value: task.__pipeline.id});\n// task.agent && props.push(\n// {text: 'stubFor', value: task.agent.uidDebug}\n// );\n// }\n// props.push(\n// {text: 'dirty', value: task._dirty},\n// {text: 'dueIndex', value: task._dueIndex},\n// {text: 'dueEnd', value: task._dueEnd},\n// {text: 'outputDueEnd', value: task._outputDueEnd}\n// );\n// if (extra) {\n// Object.keys(extra).forEach(key => {\n// props.push({text: key, value: extra[key]});\n// });\n// }\n// let args = ['color: blue'];\n// let msg = `%c[${prefix || 'T'}] %c` + props.map(item => (\n// args.push('color: green', 'color: red'),\n// `${item.text}: %c${item.value}`\n// )).join('%c, ');\n// console.log.apply(console, [msg].concat(args));\n// // console.log(this);\n// };\n// window.printPipeline = function (task: any, prefix: string) {\n// const pipeline = task.__pipeline;\n// let currTask = pipeline.head;\n// while (currTask) {\n// window.printTask(currTask, prefix);\n// currTask = currTask._downstream;\n// }\n// };\n// window.showChain = function (chainHeadTask) {\n// var chain = [];\n// var task = chainHeadTask;\n// while (task) {\n// chain.push({\n// task: task,\n// up: task._upstream,\n// down: task._downstream,\n// idxInPipeline: task.__idxInPipeline\n// });\n// task = task._downstream;\n// }\n// return chain;\n// };\n// window.findTaskInChain = function (task, chainHeadTask) {\n// let chain = window.showChain(chainHeadTask);\n// let result = [];\n// for (let i = 0; i < chain.length; i++) {\n// let chainItem = chain[i];\n// if (chainItem.task === task) {\n// result.push(i);\n// }\n// }\n// return result;\n// };\n// window.printChainAEachInChainB = function (chainHeadTaskA, chainHeadTaskB) {\n// let chainA = window.showChain(chainHeadTaskA);\n// for (let i = 0; i < chainA.length; i++) {\n// console.log('chainAIdx:', i, 'inChainB:', window.findTaskInChain(chainA[i].task, chainHeadTaskB));\n// }\n// };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { assert, clone, createHashMap, isFunction, keys, map, reduce } from 'zrender/lib/core/util';\nimport { parseDataValue } from './helper/dataValueHelper';\nimport { shouldRetrieveDataByName } from './Source';\nvar UNDEFINED = 'undefined';\n/* global Float64Array, Int32Array, Uint32Array, Uint16Array */\n// Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is\n// different from the Ctor of typed array.\n\nexport var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;\nexport var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;\nexport var CtorInt32Array = typeof Int32Array === UNDEFINED ? Array : Int32Array;\nexport var CtorFloat64Array = typeof Float64Array === UNDEFINED ? Array : Float64Array;\n/**\n * Multi dimensional data store\n */\n\nvar dataCtors = {\n 'float': CtorFloat64Array,\n 'int': CtorInt32Array,\n // Ordinal data type can be string or int\n 'ordinal': Array,\n 'number': Array,\n 'time': CtorFloat64Array\n};\nvar defaultDimValueGetters;\n\nfunction getIndicesCtor(rawCount) {\n // The possible max value in this._indicies is always this._rawCount despite of filtering.\n return rawCount > 65535 ? CtorUint32Array : CtorUint16Array;\n}\n\n;\n\nfunction getInitialExtent() {\n return [Infinity, -Infinity];\n}\n\n;\n\nfunction cloneChunk(originalChunk) {\n var Ctor = originalChunk.constructor; // Only shallow clone is enough when Array.\n\n return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk);\n}\n\nfunction prepareStore(store, dimIdx, dimType, end, append) {\n var DataCtor = dataCtors[dimType || 'float'];\n\n if (append) {\n var oldStore = store[dimIdx];\n var oldLen = oldStore && oldStore.length;\n\n if (!(oldLen === end)) {\n var newStore = new DataCtor(end); // The cost of the copy is probably inconsiderable\n // within the initial chunkSize.\n\n for (var j = 0; j < oldLen; j++) {\n newStore[j] = oldStore[j];\n }\n\n store[dimIdx] = newStore;\n }\n } else {\n store[dimIdx] = new DataCtor(end);\n }\n}\n\n;\n/**\n * Basically, DataStore API keep immutable.\n */\n\nvar DataStore =\n/** @class */\nfunction () {\n function DataStore() {\n this._chunks = []; // It will not be calculated util needed.\n\n this._rawExtent = [];\n this._extent = [];\n this._count = 0;\n this._rawCount = 0;\n this._calcDimNameToIdx = createHashMap();\n }\n /**\n * Initialize from data\n */\n\n\n DataStore.prototype.initData = function (provider, inputDimensions, dimValueGetter) {\n if (process.env.NODE_ENV !== 'production') {\n assert(isFunction(provider.getItem) && isFunction(provider.count), 'Inavlid data provider.');\n }\n\n this._provider = provider; // Clear\n\n this._chunks = [];\n this._indices = null;\n this.getRawIndex = this._getRawIdxIdentity;\n var source = provider.getSource();\n var defaultGetter = this.defaultDimValueGetter = defaultDimValueGetters[source.sourceFormat]; // Default dim value getter\n\n this._dimValueGetter = dimValueGetter || defaultGetter; // Reset raw extent.\n\n this._rawExtent = [];\n var willRetrieveDataByName = shouldRetrieveDataByName(source);\n this._dimensions = map(inputDimensions, function (dim) {\n if (process.env.NODE_ENV !== 'production') {\n if (willRetrieveDataByName) {\n assert(dim.property != null);\n }\n }\n\n return {\n // Only pick these two props. Not leak other properties like orderMeta.\n type: dim.type,\n property: dim.property\n };\n });\n\n this._initDataFromProvider(0, provider.count());\n };\n\n DataStore.prototype.getProvider = function () {\n return this._provider;\n };\n /**\n * Caution: even when a `source` instance owned by a series, the created data store\n * may still be shared by different sereis (the source hash does not use all `source`\n * props, see `sourceManager`). In this case, the `source` props that are not used in\n * hash (like `source.dimensionDefine`) probably only belongs to a certain series and\n * thus should not be fetch here.\n */\n\n\n DataStore.prototype.getSource = function () {\n return this._provider.getSource();\n };\n /**\n * @caution Only used in dataStack.\n */\n\n\n DataStore.prototype.ensureCalculationDimension = function (dimName, type) {\n var calcDimNameToIdx = this._calcDimNameToIdx;\n var dimensions = this._dimensions;\n var calcDimIdx = calcDimNameToIdx.get(dimName);\n\n if (calcDimIdx != null) {\n if (dimensions[calcDimIdx].type === type) {\n return calcDimIdx;\n }\n } else {\n calcDimIdx = dimensions.length;\n }\n\n dimensions[calcDimIdx] = {\n type: type\n };\n calcDimNameToIdx.set(dimName, calcDimIdx);\n this._chunks[calcDimIdx] = new dataCtors[type || 'float'](this._rawCount);\n this._rawExtent[calcDimIdx] = getInitialExtent();\n return calcDimIdx;\n };\n\n DataStore.prototype.collectOrdinalMeta = function (dimIdx, ordinalMeta) {\n var chunk = this._chunks[dimIdx];\n var dim = this._dimensions[dimIdx];\n var rawExtents = this._rawExtent;\n var offset = dim.ordinalOffset || 0;\n var len = chunk.length;\n\n if (offset === 0) {\n // We need to reset the rawExtent if collect is from start.\n // Because this dimension may be guessed as number and calcuating a wrong extent.\n rawExtents[dimIdx] = getInitialExtent();\n }\n\n var dimRawExtent = rawExtents[dimIdx]; // Parse from previous data offset. len may be changed after appendData\n\n for (var i = offset; i < len; i++) {\n var val = chunk[i] = ordinalMeta.parseAndCollect(chunk[i]);\n dimRawExtent[0] = Math.min(val, dimRawExtent[0]);\n dimRawExtent[1] = Math.max(val, dimRawExtent[1]);\n }\n\n dim.ordinalMeta = ordinalMeta;\n dim.ordinalOffset = len;\n dim.type = 'ordinal'; // Force to be ordinal\n };\n\n DataStore.prototype.getOrdinalMeta = function (dimIdx) {\n var dimInfo = this._dimensions[dimIdx];\n var ordinalMeta = dimInfo.ordinalMeta;\n return ordinalMeta;\n };\n\n DataStore.prototype.getDimensionProperty = function (dimIndex) {\n var item = this._dimensions[dimIndex];\n return item && item.property;\n };\n /**\n * Caution: Can be only called on raw data (before `this._indices` created).\n */\n\n\n DataStore.prototype.appendData = function (data) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this._indices, 'appendData can only be called on raw data.');\n }\n\n var provider = this._provider;\n var start = this.count();\n provider.appendData(data);\n var end = provider.count();\n\n if (!provider.persistent) {\n end += start;\n }\n\n if (start < end) {\n this._initDataFromProvider(start, end, true);\n }\n\n return [start, end];\n };\n\n DataStore.prototype.appendValues = function (values, minFillLen) {\n var chunks = this._chunks;\n var dimensions = this._dimensions;\n var dimLen = dimensions.length;\n var rawExtent = this._rawExtent;\n var start = this.count();\n var end = start + Math.max(values.length, minFillLen || 0);\n\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n prepareStore(chunks, i, dim.type, end, true);\n }\n\n var emptyDataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n var sourceIdx = idx - start; // Store the data by dimensions\n\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n var dim = dimensions[dimIdx];\n var val = defaultDimValueGetters.arrayRows.call(this, values[sourceIdx] || emptyDataItem, dim.property, sourceIdx, dimIdx);\n chunks[dimIdx][idx] = val;\n var dimRawExtent = rawExtent[dimIdx];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n }\n }\n\n this._rawCount = this._count = end;\n return {\n start: start,\n end: end\n };\n };\n\n DataStore.prototype._initDataFromProvider = function (start, end, append) {\n var provider = this._provider;\n var chunks = this._chunks;\n var dimensions = this._dimensions;\n var dimLen = dimensions.length;\n var rawExtent = this._rawExtent;\n var dimNames = map(dimensions, function (dim) {\n return dim.property;\n });\n\n for (var i = 0; i < dimLen; i++) {\n var dim = dimensions[i];\n\n if (!rawExtent[i]) {\n rawExtent[i] = getInitialExtent();\n }\n\n prepareStore(chunks, i, dim.type, end, append);\n }\n\n if (provider.fillStorage) {\n provider.fillStorage(start, end, chunks, rawExtent);\n } else {\n var dataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n // NOTICE: Try not to write things into dataItem\n dataItem = provider.getItem(idx, dataItem); // Each data item is value\n // [1, 2]\n // 2\n // Bar chart, line chart which uses category axis\n // only gives the 'y' value. 'x' value is the indices of category\n // Use a tempValue to normalize the value to be a (x, y) value\n // Store the data by dimensions\n\n for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {\n var dimStorage = chunks[dimIdx]; // PENDING NULL is empty or zero\n\n var val = this._dimValueGetter(dataItem, dimNames[dimIdx], idx, dimIdx);\n\n dimStorage[idx] = val;\n var dimRawExtent = rawExtent[dimIdx];\n val < dimRawExtent[0] && (dimRawExtent[0] = val);\n val > dimRawExtent[1] && (dimRawExtent[1] = val);\n }\n }\n }\n\n if (!provider.persistent && provider.clean) {\n // Clean unused data if data source is typed array.\n provider.clean();\n }\n\n this._rawCount = this._count = end; // Reset data extent\n\n this._extent = [];\n };\n\n DataStore.prototype.count = function () {\n return this._count;\n };\n /**\n * Get value. Return NaN if idx is out of range.\n */\n\n\n DataStore.prototype.get = function (dim, idx) {\n if (!(idx >= 0 && idx < this._count)) {\n return NaN;\n }\n\n var dimStore = this._chunks[dim];\n return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;\n };\n\n DataStore.prototype.getValues = function (dimensions, idx) {\n var values = [];\n var dimArr = [];\n\n if (idx == null) {\n idx = dimensions; // TODO get all from store?\n\n dimensions = []; // All dimensions\n\n for (var i = 0; i < this._dimensions.length; i++) {\n dimArr.push(i);\n }\n } else {\n dimArr = dimensions;\n }\n\n for (var i = 0, len = dimArr.length; i < len; i++) {\n values.push(this.get(dimArr[i], idx));\n }\n\n return values;\n };\n /**\n * @param dim concrete dim\n */\n\n\n DataStore.prototype.getByRawIndex = function (dim, rawIdx) {\n if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {\n return NaN;\n }\n\n var dimStore = this._chunks[dim];\n return dimStore ? dimStore[rawIdx] : NaN;\n };\n /**\n * Get sum of data in one dimension\n */\n\n\n DataStore.prototype.getSum = function (dim) {\n var dimData = this._chunks[dim];\n var sum = 0;\n\n if (dimData) {\n for (var i = 0, len = this.count(); i < len; i++) {\n var value = this.get(dim, i);\n\n if (!isNaN(value)) {\n sum += value;\n }\n }\n }\n\n return sum;\n };\n /**\n * Get median of data in one dimension\n */\n\n\n DataStore.prototype.getMedian = function (dim) {\n var dimDataArray = []; // map all data of one dimension\n\n this.each([dim], function (val) {\n if (!isNaN(val)) {\n dimDataArray.push(val);\n }\n }); // TODO\n // Use quick select?\n\n var sortedDimDataArray = dimDataArray.sort(function (a, b) {\n return a - b;\n });\n var len = this.count(); // calculate median\n\n return len === 0 ? 0 : len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2;\n };\n /**\n * Retreive the index with given raw data index\n */\n\n\n DataStore.prototype.indexOfRawIndex = function (rawIndex) {\n if (rawIndex >= this._rawCount || rawIndex < 0) {\n return -1;\n }\n\n if (!this._indices) {\n return rawIndex;\n } // Indices are ascending\n\n\n var indices = this._indices; // If rawIndex === dataIndex\n\n var rawDataIndex = indices[rawIndex];\n\n if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {\n return rawIndex;\n }\n\n var left = 0;\n var right = this._count - 1;\n\n while (left <= right) {\n var mid = (left + right) / 2 | 0;\n\n if (indices[mid] < rawIndex) {\n left = mid + 1;\n } else if (indices[mid] > rawIndex) {\n right = mid - 1;\n } else {\n return mid;\n }\n }\n\n return -1;\n };\n /**\n * Retreive the index of nearest value\n * @param dim\n * @param value\n * @param [maxDistance=Infinity]\n * @return If and only if multiple indices has\n * the same value, they are put to the result.\n */\n\n\n DataStore.prototype.indicesOfNearest = function (dim, value, maxDistance) {\n var chunks = this._chunks;\n var dimData = chunks[dim];\n var nearestIndices = [];\n\n if (!dimData) {\n return nearestIndices;\n }\n\n if (maxDistance == null) {\n maxDistance = Infinity;\n }\n\n var minDist = Infinity;\n var minDiff = -1;\n var nearestIndicesLen = 0; // Check the test case of `test/ut/spec/data/SeriesData.js`.\n\n for (var i = 0, len = this.count(); i < len; i++) {\n var dataIndex = this.getRawIndex(i);\n var diff = value - dimData[dataIndex];\n var dist = Math.abs(diff);\n\n if (dist <= maxDistance) {\n // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`,\n // we'd better not push both of them to `nearestIndices`, otherwise it is easy to\n // get more than one item in `nearestIndices` (more specifically, in `tooltip`).\n // So we chose the one that `diff >= 0` in this csae.\n // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them\n // should be push to `nearestIndices`.\n if (dist < minDist || dist === minDist && diff >= 0 && minDiff < 0) {\n minDist = dist;\n minDiff = diff;\n nearestIndicesLen = 0;\n }\n\n if (diff === minDiff) {\n nearestIndices[nearestIndicesLen++] = i;\n }\n }\n }\n\n nearestIndices.length = nearestIndicesLen;\n return nearestIndices;\n };\n\n DataStore.prototype.getIndices = function () {\n var newIndices;\n var indices = this._indices;\n\n if (indices) {\n var Ctor = indices.constructor;\n var thisCount = this._count; // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`.\n\n if (Ctor === Array) {\n newIndices = new Ctor(thisCount);\n\n for (var i = 0; i < thisCount; i++) {\n newIndices[i] = indices[i];\n }\n } else {\n newIndices = new Ctor(indices.buffer, 0, thisCount);\n }\n } else {\n var Ctor = getIndicesCtor(this._rawCount);\n newIndices = new Ctor(this.count());\n\n for (var i = 0; i < newIndices.length; i++) {\n newIndices[i] = i;\n }\n }\n\n return newIndices;\n };\n /**\n * Data filter.\n */\n\n\n DataStore.prototype.filter = function (dims, cb) {\n if (!this._count) {\n return this;\n }\n\n var newStore = this.clone();\n var count = newStore.count();\n var Ctor = getIndicesCtor(newStore._rawCount);\n var newIndices = new Ctor(count);\n var value = [];\n var dimSize = dims.length;\n var offset = 0;\n var dim0 = dims[0];\n var chunks = newStore._chunks;\n\n for (var i = 0; i < count; i++) {\n var keep = void 0;\n var rawIdx = newStore.getRawIndex(i); // Simple optimization\n\n if (dimSize === 0) {\n keep = cb(i);\n } else if (dimSize === 1) {\n var val = chunks[dim0][rawIdx];\n keep = cb(val, i);\n } else {\n var k = 0;\n\n for (; k < dimSize; k++) {\n value[k] = chunks[dims[k]][rawIdx];\n }\n\n value[k] = i;\n keep = cb.apply(null, value);\n }\n\n if (keep) {\n newIndices[offset++] = rawIdx;\n }\n } // Set indices after filtered.\n\n\n if (offset < count) {\n newStore._indices = newIndices;\n }\n\n newStore._count = offset; // Reset data extent\n\n newStore._extent = [];\n\n newStore._updateGetRawIdx();\n\n return newStore;\n };\n /**\n * Select data in range. (For optimization of filter)\n * (Manually inline code, support 5 million data filtering in data zoom.)\n */\n\n\n DataStore.prototype.selectRange = function (range) {\n var newStore = this.clone();\n var len = newStore._count;\n\n if (!len) {\n return this;\n }\n\n var dims = keys(range);\n var dimSize = dims.length;\n\n if (!dimSize) {\n return this;\n }\n\n var originalCount = newStore.count();\n var Ctor = getIndicesCtor(newStore._rawCount);\n var newIndices = new Ctor(originalCount);\n var offset = 0;\n var dim0 = dims[0];\n var min = range[dim0][0];\n var max = range[dim0][1];\n var storeArr = newStore._chunks;\n var quickFinished = false;\n\n if (!newStore._indices) {\n // Extreme optimization for common case. About 2x faster in chrome.\n var idx = 0;\n\n if (dimSize === 1) {\n var dimStorage = storeArr[dims[0]];\n\n for (var i = 0; i < len; i++) {\n var val = dimStorage[i]; // NaN will not be filtered. Consider the case, in line chart, empty\n // value indicates the line should be broken. But for the case like\n // scatter plot, a data item with empty value will not be rendered,\n // but the axis extent may be effected if some other dim of the data\n // item has value. Fortunately it is not a significant negative effect.\n\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = idx;\n }\n\n idx++;\n }\n\n quickFinished = true;\n } else if (dimSize === 2) {\n var dimStorage = storeArr[dims[0]];\n var dimStorage2 = storeArr[dims[1]];\n var min2 = range[dims[1]][0];\n var max2 = range[dims[1]][1];\n\n for (var i = 0; i < len; i++) {\n var val = dimStorage[i];\n var val2 = dimStorage2[i]; // Do not filter NaN, see comment above.\n\n if ((val >= min && val <= max || isNaN(val)) && (val2 >= min2 && val2 <= max2 || isNaN(val2))) {\n newIndices[offset++] = idx;\n }\n\n idx++;\n }\n\n quickFinished = true;\n }\n }\n\n if (!quickFinished) {\n if (dimSize === 1) {\n for (var i = 0; i < originalCount; i++) {\n var rawIndex = newStore.getRawIndex(i);\n var val = storeArr[dims[0]][rawIndex]; // Do not filter NaN, see comment above.\n\n if (val >= min && val <= max || isNaN(val)) {\n newIndices[offset++] = rawIndex;\n }\n }\n } else {\n for (var i = 0; i < originalCount; i++) {\n var keep = true;\n var rawIndex = newStore.getRawIndex(i);\n\n for (var k = 0; k < dimSize; k++) {\n var dimk = dims[k];\n var val = storeArr[dimk][rawIndex]; // Do not filter NaN, see comment above.\n\n if (val < range[dimk][0] || val > range[dimk][1]) {\n keep = false;\n }\n }\n\n if (keep) {\n newIndices[offset++] = newStore.getRawIndex(i);\n }\n }\n }\n } // Set indices after filtered.\n\n\n if (offset < originalCount) {\n newStore._indices = newIndices;\n }\n\n newStore._count = offset; // Reset data extent\n\n newStore._extent = [];\n\n newStore._updateGetRawIdx();\n\n return newStore;\n }; // /**\n // * Data mapping to a plain array\n // */\n // mapArray(dims: DimensionIndex[], cb: MapArrayCb): any[] {\n // const result: any[] = [];\n // this.each(dims, function () {\n // result.push(cb && (cb as MapArrayCb).apply(null, arguments));\n // });\n // return result;\n // }\n\n /**\n * Data mapping to a new List with given dimensions\n */\n\n\n DataStore.prototype.map = function (dims, cb) {\n // TODO only clone picked chunks.\n var target = this.clone(dims);\n\n this._updateDims(target, dims, cb);\n\n return target;\n };\n /**\n * @caution Danger!! Only used in dataStack.\n */\n\n\n DataStore.prototype.modify = function (dims, cb) {\n this._updateDims(this, dims, cb);\n };\n\n DataStore.prototype._updateDims = function (target, dims, cb) {\n var targetChunks = target._chunks;\n var tmpRetValue = [];\n var dimSize = dims.length;\n var dataCount = target.count();\n var values = [];\n var rawExtent = target._rawExtent;\n\n for (var i = 0; i < dims.length; i++) {\n rawExtent[dims[i]] = getInitialExtent();\n }\n\n for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {\n var rawIndex = target.getRawIndex(dataIndex);\n\n for (var k = 0; k < dimSize; k++) {\n values[k] = targetChunks[dims[k]][rawIndex];\n }\n\n values[dimSize] = dataIndex;\n var retValue = cb && cb.apply(null, values);\n\n if (retValue != null) {\n // a number or string (in oridinal dimension)?\n if (typeof retValue !== 'object') {\n tmpRetValue[0] = retValue;\n retValue = tmpRetValue;\n }\n\n for (var i = 0; i < retValue.length; i++) {\n var dim = dims[i];\n var val = retValue[i];\n var rawExtentOnDim = rawExtent[dim];\n var dimStore = targetChunks[dim];\n\n if (dimStore) {\n dimStore[rawIndex] = val;\n }\n\n if (val < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = val;\n }\n\n if (val > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = val;\n }\n }\n }\n }\n };\n /**\n * Large data down sampling using largest-triangle-three-buckets\n * @param {string} valueDimension\n * @param {number} targetCount\n */\n\n\n DataStore.prototype.lttbDownSample = function (valueDimension, rate) {\n var target = this.clone([valueDimension], true);\n var targetStorage = target._chunks;\n var dimStore = targetStorage[valueDimension];\n var len = this.count();\n var sampledIndex = 0;\n var frameSize = Math.floor(1 / rate);\n var currentRawIndex = this.getRawIndex(0);\n var maxArea;\n var area;\n var nextRawIndex;\n var newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len / frameSize) + 2); // First frame use the first data.\n\n newIndices[sampledIndex++] = currentRawIndex;\n\n for (var i = 1; i < len - 1; i += frameSize) {\n var nextFrameStart = Math.min(i + frameSize, len - 1);\n var nextFrameEnd = Math.min(i + frameSize * 2, len);\n var avgX = (nextFrameEnd + nextFrameStart) / 2;\n var avgY = 0;\n\n for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {\n var rawIndex = this.getRawIndex(idx);\n var y = dimStore[rawIndex];\n\n if (isNaN(y)) {\n continue;\n }\n\n avgY += y;\n }\n\n avgY /= nextFrameEnd - nextFrameStart;\n var frameStart = i;\n var frameEnd = Math.min(i + frameSize, len);\n var pointAX = i - 1;\n var pointAY = dimStore[currentRawIndex];\n maxArea = -1;\n nextRawIndex = frameStart; // Find a point from current frame that construct a triangel with largest area with previous selected point\n // And the average of next frame.\n\n for (var idx = frameStart; idx < frameEnd; idx++) {\n var rawIndex = this.getRawIndex(idx);\n var y = dimStore[rawIndex];\n\n if (isNaN(y)) {\n continue;\n } // Calculate triangle area over three buckets\n\n\n area = Math.abs((pointAX - avgX) * (y - pointAY) - (pointAX - idx) * (avgY - pointAY));\n\n if (area > maxArea) {\n maxArea = area;\n nextRawIndex = rawIndex; // Next a is this b\n }\n }\n\n newIndices[sampledIndex++] = nextRawIndex;\n currentRawIndex = nextRawIndex; // This a is the next a (chosen b)\n } // First frame use the last data.\n\n\n newIndices[sampledIndex++] = this.getRawIndex(len - 1);\n target._count = sampledIndex;\n target._indices = newIndices;\n target.getRawIndex = this._getRawIdx;\n return target;\n };\n /**\n * Large data down sampling on given dimension\n * @param sampleIndex Sample index for name and id\n */\n\n\n DataStore.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n var target = this.clone([dimension], true);\n var targetStorage = target._chunks;\n var frameValues = [];\n var frameSize = Math.floor(1 / rate);\n var dimStore = targetStorage[dimension];\n var len = this.count();\n var rawExtentOnDim = target._rawExtent[dimension] = getInitialExtent();\n var newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len / frameSize));\n var offset = 0;\n\n for (var i = 0; i < len; i += frameSize) {\n // Last frame\n if (frameSize > len - i) {\n frameSize = len - i;\n frameValues.length = frameSize;\n }\n\n for (var k = 0; k < frameSize; k++) {\n var dataIdx = this.getRawIndex(i + k);\n frameValues[k] = dimStore[dataIdx];\n }\n\n var value = sampleValue(frameValues);\n var sampleFrameIdx = this.getRawIndex(Math.min(i + sampleIndex(frameValues, value) || 0, len - 1)); // Only write value on the filtered data\n\n dimStore[sampleFrameIdx] = value;\n\n if (value < rawExtentOnDim[0]) {\n rawExtentOnDim[0] = value;\n }\n\n if (value > rawExtentOnDim[1]) {\n rawExtentOnDim[1] = value;\n }\n\n newIndices[offset++] = sampleFrameIdx;\n }\n\n target._count = offset;\n target._indices = newIndices;\n\n target._updateGetRawIdx();\n\n return target;\n };\n /**\n * Data iteration\n * @param ctx default this\n * @example\n * list.each('x', function (x, idx) {});\n * list.each(['x', 'y'], function (x, y, idx) {});\n * list.each(function (idx) {})\n */\n\n\n DataStore.prototype.each = function (dims, cb) {\n if (!this._count) {\n return;\n }\n\n var dimSize = dims.length;\n var chunks = this._chunks;\n\n for (var i = 0, len = this.count(); i < len; i++) {\n var rawIdx = this.getRawIndex(i); // Simple optimization\n\n switch (dimSize) {\n case 0:\n cb(i);\n break;\n\n case 1:\n cb(chunks[dims[0]][rawIdx], i);\n break;\n\n case 2:\n cb(chunks[dims[0]][rawIdx], chunks[dims[1]][rawIdx], i);\n break;\n\n default:\n var k = 0;\n var value = [];\n\n for (; k < dimSize; k++) {\n value[k] = chunks[dims[k]][rawIdx];\n } // Index\n\n\n value[k] = i;\n cb.apply(null, value);\n }\n }\n };\n /**\n * Get extent of data in one dimension\n */\n\n\n DataStore.prototype.getDataExtent = function (dim) {\n // Make sure use concrete dim as cache name.\n var dimData = this._chunks[dim];\n var initialExtent = getInitialExtent();\n\n if (!dimData) {\n return initialExtent;\n } // Make more strict checkings to ensure hitting cache.\n\n\n var currEnd = this.count(); // Consider the most cases when using data zoom, `getDataExtent`\n // happened before filtering. We cache raw extent, which is not\n // necessary to be cleared and recalculated when restore data.\n\n var useRaw = !this._indices;\n var dimExtent;\n\n if (useRaw) {\n return this._rawExtent[dim].slice();\n }\n\n dimExtent = this._extent[dim];\n\n if (dimExtent) {\n return dimExtent.slice();\n }\n\n dimExtent = initialExtent;\n var min = dimExtent[0];\n var max = dimExtent[1];\n\n for (var i = 0; i < currEnd; i++) {\n var rawIdx = this.getRawIndex(i);\n var value = dimData[rawIdx];\n value < min && (min = value);\n value > max && (max = value);\n }\n\n dimExtent = [min, max];\n this._extent[dim] = dimExtent;\n return dimExtent;\n };\n /**\n * Get raw data item\n */\n\n\n DataStore.prototype.getRawDataItem = function (idx) {\n var rawIdx = this.getRawIndex(idx);\n\n if (!this._provider.persistent) {\n var val = [];\n var chunks = this._chunks;\n\n for (var i = 0; i < chunks.length; i++) {\n val.push(chunks[i][rawIdx]);\n }\n\n return val;\n } else {\n return this._provider.getItem(rawIdx);\n }\n };\n /**\n * Clone shallow.\n *\n * @param clonedDims Determine which dims to clone. Will share the data if not specified.\n */\n\n\n DataStore.prototype.clone = function (clonedDims, ignoreIndices) {\n var target = new DataStore();\n var chunks = this._chunks;\n var clonedDimsMap = clonedDims && reduce(clonedDims, function (obj, dimIdx) {\n obj[dimIdx] = true;\n return obj;\n }, {});\n\n if (clonedDimsMap) {\n for (var i = 0; i < chunks.length; i++) {\n // Not clone if dim is not picked.\n target._chunks[i] = !clonedDimsMap[i] ? chunks[i] : cloneChunk(chunks[i]);\n }\n } else {\n target._chunks = chunks;\n }\n\n this._copyCommonProps(target);\n\n if (!ignoreIndices) {\n target._indices = this._cloneIndices();\n }\n\n target._updateGetRawIdx();\n\n return target;\n };\n\n DataStore.prototype._copyCommonProps = function (target) {\n target._count = this._count;\n target._rawCount = this._rawCount;\n target._provider = this._provider;\n target._dimensions = this._dimensions;\n target._extent = clone(this._extent);\n target._rawExtent = clone(this._rawExtent);\n };\n\n DataStore.prototype._cloneIndices = function () {\n if (this._indices) {\n var Ctor = this._indices.constructor;\n var indices = void 0;\n\n if (Ctor === Array) {\n var thisCount = this._indices.length;\n indices = new Ctor(thisCount);\n\n for (var i = 0; i < thisCount; i++) {\n indices[i] = this._indices[i];\n }\n } else {\n indices = new Ctor(this._indices);\n }\n\n return indices;\n }\n\n return null;\n };\n\n DataStore.prototype._getRawIdxIdentity = function (idx) {\n return idx;\n };\n\n DataStore.prototype._getRawIdx = function (idx) {\n if (idx < this._count && idx >= 0) {\n return this._indices[idx];\n }\n\n return -1;\n };\n\n DataStore.prototype._updateGetRawIdx = function () {\n this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity;\n };\n\n DataStore.internalField = function () {\n function getDimValueSimply(dataItem, property, dataIndex, dimIndex) {\n return parseDataValue(dataItem[dimIndex], this._dimensions[dimIndex]);\n }\n\n defaultDimValueGetters = {\n arrayRows: getDimValueSimply,\n objectRows: function (dataItem, property, dataIndex, dimIndex) {\n return parseDataValue(dataItem[property], this._dimensions[dimIndex]);\n },\n keyedColumns: getDimValueSimply,\n original: function (dataItem, property, dataIndex, dimIndex) {\n // Performance sensitive, do not use modelUtil.getDataItemValue.\n // If dataItem is an plain object with no value field, the let `value`\n // will be assigned with the object, but it will be tread correctly\n // in the `convertValue`.\n var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);\n return parseDataValue(value instanceof Array ? value[dimIndex] // If value is a single number or something else not array.\n : value, this._dimensions[dimIndex]);\n },\n typedArray: function (dataItem, property, dataIndex, dimIndex) {\n return dataItem[dimIndex];\n }\n };\n }();\n\n return DataStore;\n}();\n\nexport default DataStore;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { assert, isArray, eqNaN, isFunction } from 'zrender/lib/core/util';\nimport { parsePercent } from 'zrender/lib/contain/text';\n\nvar ScaleRawExtentInfo =\n/** @class */\nfunction () {\n function ScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis.\n originalExtent) {\n this._prepareParams(scale, model, originalExtent);\n }\n /**\n * Parameters depending on ouside (like model, user callback)\n * are prepared and fixed here.\n */\n\n\n ScaleRawExtentInfo.prototype._prepareParams = function (scale, model, // Usually: data extent from all series on this axis.\n dataExtent) {\n if (dataExtent[1] < dataExtent[0]) {\n dataExtent = [NaN, NaN];\n }\n\n this._dataMin = dataExtent[0];\n this._dataMax = dataExtent[1];\n var isOrdinal = this._isOrdinal = scale.type === 'ordinal';\n this._needCrossZero = model.getNeedCrossZero && model.getNeedCrossZero();\n var modelMinRaw = this._modelMinRaw = model.get('min', true);\n\n if (isFunction(modelMinRaw)) {\n // This callback alway provide users the full data extent (before data filtered).\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw({\n min: dataExtent[0],\n max: dataExtent[1]\n }));\n } else if (modelMinRaw !== 'dataMin') {\n this._modelMinNum = parseAxisModelMinMax(scale, modelMinRaw);\n }\n\n var modelMaxRaw = this._modelMaxRaw = model.get('max', true);\n\n if (isFunction(modelMaxRaw)) {\n // This callback alway provide users the full data extent (before data filtered).\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw({\n min: dataExtent[0],\n max: dataExtent[1]\n }));\n } else if (modelMaxRaw !== 'dataMax') {\n this._modelMaxNum = parseAxisModelMinMax(scale, modelMaxRaw);\n }\n\n if (isOrdinal) {\n // FIXME: there is a flaw here: if there is no \"block\" data processor like `dataZoom`,\n // and progressive rendering is using, here the category result might just only contain\n // the processed chunk rather than the entire result.\n this._axisDataLen = model.getCategories().length;\n } else {\n var boundaryGap = model.get('boundaryGap');\n var boundaryGapArr = isArray(boundaryGap) ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];\n\n if (typeof boundaryGapArr[0] === 'boolean' || typeof boundaryGapArr[1] === 'boolean') {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Boolean type for boundaryGap is only ' + 'allowed for ordinal axis. Please use string in ' + 'percentage instead, e.g., \"20%\". Currently, ' + 'boundaryGap is set to be 0.');\n }\n\n this._boundaryGapInner = [0, 0];\n } else {\n this._boundaryGapInner = [parsePercent(boundaryGapArr[0], 1), parsePercent(boundaryGapArr[1], 1)];\n }\n }\n };\n /**\n * Calculate extent by prepared parameters.\n * This method has no external dependency and can be called duplicatedly,\n * getting the same result.\n * If parameters changed, should call this method to recalcuate.\n */\n\n\n ScaleRawExtentInfo.prototype.calculate = function () {\n // Notice: When min/max is not set (that is, when there are null/undefined,\n // which is the most common case), these cases should be ensured:\n // (1) For 'ordinal', show all axis.data.\n // (2) For others:\n // + `boundaryGap` is applied (if min/max set, boundaryGap is\n // disabled).\n // + If `needCrossZero`, min/max should be zero, otherwise, min/max should\n // be the result that originalExtent enlarged by boundaryGap.\n // (3) If no data, it should be ensured that `scale.setBlank` is set.\n var isOrdinal = this._isOrdinal;\n var dataMin = this._dataMin;\n var dataMax = this._dataMax;\n var axisDataLen = this._axisDataLen;\n var boundaryGapInner = this._boundaryGapInner;\n var span = !isOrdinal ? dataMax - dataMin || Math.abs(dataMin) : null; // Currently if a `'value'` axis model min is specified as 'dataMin'/'dataMax',\n // `boundaryGap` will not be used. It's the different from specifying as `null`/`undefined`.\n\n var min = this._modelMinRaw === 'dataMin' ? dataMin : this._modelMinNum;\n var max = this._modelMaxRaw === 'dataMax' ? dataMax : this._modelMaxNum; // If `_modelMinNum`/`_modelMaxNum` is `null`/`undefined`, should not be fixed.\n\n var minFixed = min != null;\n var maxFixed = max != null;\n\n if (min == null) {\n min = isOrdinal ? axisDataLen ? 0 : NaN : dataMin - boundaryGapInner[0] * span;\n }\n\n if (max == null) {\n max = isOrdinal ? axisDataLen ? axisDataLen - 1 : NaN : dataMax + boundaryGapInner[1] * span;\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n\n if (min > max) {\n min = NaN;\n max = NaN;\n }\n\n var isBlank = eqNaN(min) || eqNaN(max) || isOrdinal && !axisDataLen; // If data extent modified, need to recalculated to ensure cross zero.\n\n if (this._needCrossZero) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !minFixed) {\n min = 0; // minFixed = true;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !maxFixed) {\n max = 0; // maxFixed = true;\n } // PENDING:\n // When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n // If so, here `minFixed`/`maxFixed` need to be set.\n\n }\n\n var determinedMin = this._determinedMin;\n var determinedMax = this._determinedMax;\n\n if (determinedMin != null) {\n min = determinedMin;\n minFixed = true;\n }\n\n if (determinedMax != null) {\n max = determinedMax;\n maxFixed = true;\n } // Ensure min/max be finite number or NaN here. (not to be null/undefined)\n // `NaN` means min/max axis is blank.\n\n\n return {\n min: min,\n max: max,\n minFixed: minFixed,\n maxFixed: maxFixed,\n isBlank: isBlank\n };\n };\n\n ScaleRawExtentInfo.prototype.modifyDataMinMax = function (minMaxName, val) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this.frozen);\n }\n\n this[DATA_MIN_MAX_ATTR[minMaxName]] = val;\n };\n\n ScaleRawExtentInfo.prototype.setDeterminedMinMax = function (minMaxName, val) {\n var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];\n\n if (process.env.NODE_ENV !== 'production') {\n assert(!this.frozen // Earse them usually means logic flaw.\n && this[attr] == null);\n }\n\n this[attr] = val;\n };\n\n ScaleRawExtentInfo.prototype.freeze = function () {\n // @ts-ignore\n this.frozen = true;\n };\n\n return ScaleRawExtentInfo;\n}();\n\nexport { ScaleRawExtentInfo };\nvar DETERMINED_MIN_MAX_ATTR = {\n min: '_determinedMin',\n max: '_determinedMax'\n};\nvar DATA_MIN_MAX_ATTR = {\n min: '_dataMin',\n max: '_dataMax'\n};\n/**\n * Get scale min max and related info only depends on model settings.\n * This method can be called after coordinate system created.\n * For example, in data processing stage.\n *\n * Scale extent info probably be required multiple times during a workflow.\n * For example:\n * (1) `dataZoom` depends it to get the axis extent in \"100%\" state.\n * (2) `processor/extentCalculator` depends it to make sure whether axis extent is specified.\n * (3) `coordSys.update` use it to finally decide the scale extent.\n * But the callback of `min`/`max` should not be called multiple times.\n * The code below should not be implemented repeatedly either.\n * So we cache the result in the scale instance, which will be recreated at the begining\n * of the workflow (because `scale` instance will be recreated each round of the workflow).\n */\n\nexport function ensureScaleRawExtentInfo(scale, model, // Usually: data extent from all series on this axis.\noriginalExtent) {\n // Do not permit to recreate.\n var rawExtentInfo = scale.rawExtentInfo;\n\n if (rawExtentInfo) {\n return rawExtentInfo;\n }\n\n rawExtentInfo = new ScaleRawExtentInfo(scale, model, originalExtent); // @ts-ignore\n\n scale.rawExtentInfo = rawExtentInfo;\n return rawExtentInfo;\n}\nexport function parseAxisModelMinMax(scale, minMax) {\n return minMax == null ? null : eqNaN(minMax) ? NaN : scale.parse(minMax);\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Parse and decode geo json\n */\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { GeoJSONRegion } from './Region';\n\nfunction decode(json) {\n if (!json.UTF8Encoding) {\n return json;\n }\n\n var jsonCompressed = json;\n var encodeScale = jsonCompressed.UTF8Scale;\n\n if (encodeScale == null) {\n encodeScale = 1024;\n }\n\n var features = jsonCompressed.features;\n\n for (var f = 0; f < features.length; f++) {\n var feature = features[f];\n var geometry = feature.geometry;\n\n if (geometry.type === 'Polygon') {\n var coordinates = geometry.coordinates;\n\n for (var c = 0; c < coordinates.length; c++) {\n coordinates[c] = decodePolygon(coordinates[c], geometry.encodeOffsets[c], encodeScale);\n }\n } else if (geometry.type === 'MultiPolygon') {\n var coordinates = geometry.coordinates;\n\n for (var c = 0; c < coordinates.length; c++) {\n var coordinate = coordinates[c];\n\n for (var c2 = 0; c2 < coordinate.length; c2++) {\n coordinate[c2] = decodePolygon(coordinate[c2], geometry.encodeOffsets[c][c2], encodeScale);\n }\n }\n }\n } // Has been decoded\n\n\n jsonCompressed.UTF8Encoding = false;\n return jsonCompressed;\n}\n\nfunction decodePolygon(coordinate, encodeOffsets, encodeScale) {\n var result = [];\n var prevX = encodeOffsets[0];\n var prevY = encodeOffsets[1];\n\n for (var i = 0; i < coordinate.length; i += 2) {\n var x = coordinate.charCodeAt(i) - 64;\n var y = coordinate.charCodeAt(i + 1) - 64; // ZigZag decoding\n\n x = x >> 1 ^ -(x & 1);\n y = y >> 1 ^ -(y & 1); // Delta deocding\n\n x += prevX;\n y += prevY;\n prevX = x;\n prevY = y; // Dequantize\n\n result.push([x / encodeScale, y / encodeScale]);\n }\n\n return result;\n}\n\nexport default function parseGeoJSON(geoJson, nameProperty) {\n geoJson = decode(geoJson);\n return zrUtil.map(zrUtil.filter(geoJson.features, function (featureObj) {\n // Output of mapshaper may have geometry null\n return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0;\n }), function (featureObj) {\n var properties = featureObj.properties;\n var geo = featureObj.geometry;\n var geometries = [];\n\n if (geo.type === 'Polygon') {\n var coordinates = geo.coordinates;\n geometries.push({\n type: 'polygon',\n // According to the GeoJSON specification.\n // First must be exterior, and the rest are all interior(holes).\n exterior: coordinates[0],\n interiors: coordinates.slice(1)\n });\n }\n\n if (geo.type === 'MultiPolygon') {\n var coordinates = geo.coordinates;\n zrUtil.each(coordinates, function (item) {\n if (item[0]) {\n geometries.push({\n type: 'polygon',\n exterior: item[0],\n interiors: item.slice(1)\n });\n }\n });\n }\n\n var region = new GeoJSONRegion(properties[nameProperty || 'name'], geometries, properties.cp);\n region.properties = properties;\n return region;\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport * as bbox from 'zrender/lib/core/bbox';\nimport * as vec2 from 'zrender/lib/core/vector';\nimport * as polygonContain from 'zrender/lib/contain/polygon';\nimport * as matrix from 'zrender/lib/core/matrix';\nvar TMP_TRANSFORM = [];\n\nvar Region =\n/** @class */\nfunction () {\n function Region(name) {\n this.name = name;\n }\n /**\n * Get center point in data unit. That is,\n * for GeoJSONRegion, the unit is lat/lng,\n * for GeoSVGRegion, the unit is SVG local coord.\n */\n\n\n Region.prototype.getCenter = function () {\n return;\n };\n\n return Region;\n}();\n\nexport { Region };\n\nvar GeoJSONRegion =\n/** @class */\nfunction (_super) {\n __extends(GeoJSONRegion, _super);\n\n function GeoJSONRegion(name, geometries, cp) {\n var _this = _super.call(this, name) || this;\n\n _this.type = 'geoJSON';\n _this.geometries = geometries;\n\n if (!cp) {\n var rect = _this.getBoundingRect();\n\n cp = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n } else {\n cp = [cp[0], cp[1]];\n }\n\n _this._center = cp;\n return _this;\n }\n\n GeoJSONRegion.prototype.getBoundingRect = function () {\n var rect = this._rect;\n\n if (rect) {\n return rect;\n }\n\n var MAX_NUMBER = Number.MAX_VALUE;\n var min = [MAX_NUMBER, MAX_NUMBER];\n var max = [-MAX_NUMBER, -MAX_NUMBER];\n var min2 = [];\n var max2 = [];\n var geometries = this.geometries;\n var i = 0;\n\n for (; i < geometries.length; i++) {\n // Only support polygon\n if (geometries[i].type !== 'polygon') {\n continue;\n } // Doesn't consider hole\n\n\n var exterior = geometries[i].exterior;\n bbox.fromPoints(exterior, min2, max2);\n vec2.min(min, min, min2);\n vec2.max(max, max, max2);\n } // No data\n\n\n if (i === 0) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n\n return this._rect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n };\n\n GeoJSONRegion.prototype.contain = function (coord) {\n var rect = this.getBoundingRect();\n var geometries = this.geometries;\n\n if (!rect.contain(coord[0], coord[1])) {\n return false;\n }\n\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\n // Only support polygon.\n if (geometries[i].type !== 'polygon') {\n continue;\n }\n\n var exterior = geometries[i].exterior;\n var interiors = geometries[i].interiors;\n\n if (polygonContain.contain(exterior, coord[0], coord[1])) {\n // Not in the region if point is in the hole.\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\n if (polygonContain.contain(interiors[k], coord[0], coord[1])) {\n continue loopGeo;\n }\n }\n\n return true;\n }\n }\n\n return false;\n };\n\n GeoJSONRegion.prototype.transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var aspect = rect.width / rect.height;\n\n if (!width) {\n width = aspect * height;\n } else if (!height) {\n height = width / aspect;\n }\n\n var target = new BoundingRect(x, y, width, height);\n var transform = rect.calculateTransform(target);\n var geometries = this.geometries;\n\n for (var i = 0; i < geometries.length; i++) {\n // Only support polygon.\n if (geometries[i].type !== 'polygon') {\n continue;\n }\n\n var exterior = geometries[i].exterior;\n var interiors = geometries[i].interiors;\n\n for (var p = 0; p < exterior.length; p++) {\n vec2.applyTransform(exterior[p], exterior[p], transform);\n }\n\n for (var h = 0; h < (interiors ? interiors.length : 0); h++) {\n for (var p = 0; p < interiors[h].length; p++) {\n vec2.applyTransform(interiors[h][p], interiors[h][p], transform);\n }\n }\n }\n\n rect = this._rect;\n rect.copy(target); // Update center\n\n this._center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n };\n\n GeoJSONRegion.prototype.cloneShallow = function (name) {\n name == null && (name = this.name);\n var newRegion = new GeoJSONRegion(name, this.geometries, this._center);\n newRegion._rect = this._rect;\n newRegion.transformTo = null; // Simply avoid to be called.\n\n return newRegion;\n };\n\n GeoJSONRegion.prototype.getCenter = function () {\n return this._center;\n };\n\n GeoJSONRegion.prototype.setCenter = function (center) {\n this._center = center;\n };\n\n return GeoJSONRegion;\n}(Region);\n\nexport { GeoJSONRegion };\n\nvar GeoSVGRegion =\n/** @class */\nfunction (_super) {\n __extends(GeoSVGRegion, _super);\n\n function GeoSVGRegion(name, elOnlyForCalculate) {\n var _this = _super.call(this, name) || this;\n\n _this.type = 'geoSVG';\n _this._elOnlyForCalculate = elOnlyForCalculate;\n return _this;\n }\n\n GeoSVGRegion.prototype.getCenter = function () {\n var center = this._center;\n\n if (!center) {\n // In most cases there are no need to calculate this center.\n // So calculate only when called.\n center = this._center = this._calculateCenter();\n }\n\n return center;\n };\n\n GeoSVGRegion.prototype._calculateCenter = function () {\n var el = this._elOnlyForCalculate;\n var rect = el.getBoundingRect();\n var center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n var mat = matrix.identity(TMP_TRANSFORM);\n var target = el;\n\n while (target && !target.isGeoSVGGraphicRoot) {\n matrix.mul(mat, target.getLocalTransform(), mat);\n target = target.parent;\n }\n\n matrix.invert(mat, mat);\n vec2.applyTransform(center, center, mat);\n return center;\n };\n\n return GeoSVGRegion;\n}(Region);\n\nexport { GeoSVGRegion };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Tree data structure\n */\nimport * as zrUtil from 'zrender/lib/core/util';\nimport linkSeriesData from './helper/linkSeriesData';\nimport SeriesData from './SeriesData';\nimport prepareSeriesDataSchema from './helper/createDimensions';\nimport { convertOptionIdName } from '../util/model';\n\nvar TreeNode =\n/** @class */\nfunction () {\n function TreeNode(name, hostTree) {\n this.depth = 0;\n this.height = 0;\n /**\n * Reference to list item.\n * Do not persistent dataIndex outside,\n * besause it may be changed by list.\n * If dataIndex -1,\n * this node is logical deleted (filtered) in list.\n */\n\n this.dataIndex = -1;\n this.children = [];\n this.viewChildren = [];\n this.isExpand = false;\n this.name = name || '';\n this.hostTree = hostTree;\n }\n /**\n * The node is removed.\n */\n\n\n TreeNode.prototype.isRemoved = function () {\n return this.dataIndex < 0;\n };\n\n TreeNode.prototype.eachNode = function (options, cb, context) {\n if (typeof options === 'function') {\n context = cb;\n cb = options;\n options = null;\n }\n\n options = options || {};\n\n if (zrUtil.isString(options)) {\n options = {\n order: options\n };\n }\n\n var order = options.order || 'preorder';\n var children = this[options.attr || 'children'];\n var suppressVisitSub;\n order === 'preorder' && (suppressVisitSub = cb.call(context, this));\n\n for (var i = 0; !suppressVisitSub && i < children.length; i++) {\n children[i].eachNode(options, cb, context);\n }\n\n order === 'postorder' && cb.call(context, this);\n };\n /**\n * Update depth and height of this subtree.\n */\n\n\n TreeNode.prototype.updateDepthAndHeight = function (depth) {\n var height = 0;\n this.depth = depth;\n\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n child.updateDepthAndHeight(depth + 1);\n\n if (child.height > height) {\n height = child.height;\n }\n }\n\n this.height = height + 1;\n };\n\n TreeNode.prototype.getNodeById = function (id) {\n if (this.getId() === id) {\n return this;\n }\n\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\n var res = children[i].getNodeById(id);\n\n if (res) {\n return res;\n }\n }\n };\n\n TreeNode.prototype.contains = function (node) {\n if (node === this) {\n return true;\n }\n\n for (var i = 0, children = this.children, len = children.length; i < len; i++) {\n var res = children[i].contains(node);\n\n if (res) {\n return res;\n }\n }\n };\n /**\n * @param includeSelf Default false.\n * @return order: [root, child, grandchild, ...]\n */\n\n\n TreeNode.prototype.getAncestors = function (includeSelf) {\n var ancestors = [];\n var node = includeSelf ? this : this.parentNode;\n\n while (node) {\n ancestors.push(node);\n node = node.parentNode;\n }\n\n ancestors.reverse();\n return ancestors;\n };\n\n TreeNode.prototype.getAncestorsIndices = function () {\n var indices = [];\n var currNode = this;\n\n while (currNode) {\n indices.push(currNode.dataIndex);\n currNode = currNode.parentNode;\n }\n\n indices.reverse();\n return indices;\n };\n\n TreeNode.prototype.getDescendantIndices = function () {\n var indices = [];\n this.eachNode(function (childNode) {\n indices.push(childNode.dataIndex);\n });\n return indices;\n };\n\n TreeNode.prototype.getValue = function (dimension) {\n var data = this.hostTree.data;\n return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex);\n };\n\n TreeNode.prototype.setLayout = function (layout, merge) {\n this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge);\n };\n /**\n * @return {Object} layout\n */\n\n\n TreeNode.prototype.getLayout = function () {\n return this.hostTree.data.getItemLayout(this.dataIndex);\n }; // @depcrecated\n // getModel(path: S): Model\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n\n TreeNode.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var hostTree = this.hostTree;\n var itemModel = hostTree.data.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n }; // TODO: TYPE More specific model\n\n\n TreeNode.prototype.getLevelModel = function () {\n return (this.hostTree.levelModels || [])[this.depth];\n };\n\n TreeNode.prototype.setVisual = function (key, value) {\n this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key, value);\n };\n /**\n * Get item visual\n * FIXME: make return type better\n */\n\n\n TreeNode.prototype.getVisual = function (key) {\n return this.hostTree.data.getItemVisual(this.dataIndex, key);\n };\n\n TreeNode.prototype.getRawIndex = function () {\n return this.hostTree.data.getRawIndex(this.dataIndex);\n };\n\n TreeNode.prototype.getId = function () {\n return this.hostTree.data.getId(this.dataIndex);\n };\n /**\n * index in parent's children\n */\n\n\n TreeNode.prototype.getChildIndex = function () {\n if (this.parentNode) {\n var children = this.parentNode.children;\n\n for (var i = 0; i < children.length; ++i) {\n if (children[i] === this) {\n return i;\n }\n }\n\n return -1;\n }\n\n return -1;\n };\n /**\n * if this is an ancestor of another node\n *\n * @param node another node\n * @return if is ancestor\n */\n\n\n TreeNode.prototype.isAncestorOf = function (node) {\n var parent = node.parentNode;\n\n while (parent) {\n if (parent === this) {\n return true;\n }\n\n parent = parent.parentNode;\n }\n\n return false;\n };\n /**\n * if this is an descendant of another node\n *\n * @param node another node\n * @return if is descendant\n */\n\n\n TreeNode.prototype.isDescendantOf = function (node) {\n return node !== this && node.isAncestorOf(this);\n };\n\n return TreeNode;\n}();\n\nexport { TreeNode };\n;\n\nvar Tree =\n/** @class */\nfunction () {\n function Tree(hostModel) {\n this.type = 'tree';\n this._nodes = [];\n this.hostModel = hostModel;\n }\n\n Tree.prototype.eachNode = function (options, cb, context) {\n this.root.eachNode(options, cb, context);\n };\n\n Tree.prototype.getNodeByDataIndex = function (dataIndex) {\n var rawIndex = this.data.getRawIndex(dataIndex);\n return this._nodes[rawIndex];\n };\n\n Tree.prototype.getNodeById = function (name) {\n return this.root.getNodeById(name);\n };\n /**\n * Update item available by list,\n * when list has been performed options like 'filterSelf' or 'map'.\n */\n\n\n Tree.prototype.update = function () {\n var data = this.data;\n var nodes = this._nodes;\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n nodes[i].dataIndex = -1;\n }\n\n for (var i = 0, len = data.count(); i < len; i++) {\n nodes[data.getRawIndex(i)].dataIndex = i;\n }\n };\n /**\n * Clear all layouts\n */\n\n\n Tree.prototype.clearLayouts = function () {\n this.data.clearItemLayouts();\n };\n /**\n * data node format:\n * {\n * name: ...\n * value: ...\n * children: [\n * {\n * name: ...\n * value: ...\n * children: ...\n * },\n * ...\n * ]\n * }\n */\n\n\n Tree.createTree = function (dataRoot, hostModel, beforeLink) {\n var tree = new Tree(hostModel);\n var listData = [];\n var dimMax = 1;\n buildHierarchy(dataRoot);\n\n function buildHierarchy(dataNode, parentNode) {\n var value = dataNode.value;\n dimMax = Math.max(dimMax, zrUtil.isArray(value) ? value.length : 1);\n listData.push(dataNode);\n var node = new TreeNode(convertOptionIdName(dataNode.name, ''), tree);\n parentNode ? addChild(node, parentNode) : tree.root = node;\n\n tree._nodes.push(node);\n\n var children = dataNode.children;\n\n if (children) {\n for (var i = 0; i < children.length; i++) {\n buildHierarchy(children[i], node);\n }\n }\n }\n\n tree.root.updateDepthAndHeight(0);\n var dimensions = prepareSeriesDataSchema(listData, {\n coordDimensions: ['value'],\n dimensionsCount: dimMax\n }).dimensions;\n var list = new SeriesData(dimensions, hostModel);\n list.initData(listData);\n beforeLink && beforeLink(list);\n linkSeriesData({\n mainData: list,\n struct: tree,\n structAttr: 'tree'\n });\n tree.update();\n return tree;\n };\n\n return Tree;\n}();\n/**\n * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote,\n * so this function is not ready and not necessary to be public.\n */\n\n\nfunction addChild(child, node) {\n var children = node.children;\n\n if (child.parentNode === node) {\n return;\n }\n\n children.push(child);\n child.parentNode = node;\n}\n\nexport default Tree;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\n\nvar SeriesDimensionDefine =\n/** @class */\nfunction () {\n /**\n * @param opt All of the fields will be shallow copied.\n */\n function SeriesDimensionDefine(opt) {\n /**\n * The format of `otherDims` is:\n * ```js\n * {\n * tooltip?: number\n * label?: number\n * itemName?: number\n * seriesName?: number\n * }\n * ```\n *\n * A `series.encode` can specified these fields:\n * ```js\n * encode: {\n * // \"3, 1, 5\" is the index of data dimension.\n * tooltip: [3, 1, 5],\n * label: [0, 3],\n * ...\n * }\n * ```\n * `otherDims` is the parse result of the `series.encode` above, like:\n * ```js\n * // Suppose the index of this data dimension is `3`.\n * this.otherDims = {\n * // `3` is at the index `0` of the `encode.tooltip`\n * tooltip: 0,\n * // `3` is at the index `1` of the `encode.label`\n * label: 1\n * };\n * ```\n *\n * This prop should never be `null`/`undefined` after initialized.\n */\n this.otherDims = {};\n\n if (opt != null) {\n zrUtil.extend(this, opt);\n }\n }\n\n return SeriesDimensionDefine;\n}();\n\n;\nexport default SeriesDimensionDefine;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { createHashMap, isObject, map } from 'zrender/lib/core/util';\nvar uidBase = 0;\n\nvar OrdinalMeta =\n/** @class */\nfunction () {\n function OrdinalMeta(opt) {\n this.categories = opt.categories || [];\n this._needCollect = opt.needCollect;\n this._deduplication = opt.deduplication;\n this.uid = ++uidBase;\n }\n\n OrdinalMeta.createByAxisModel = function (axisModel) {\n var option = axisModel.option;\n var data = option.data;\n var categories = data && map(data, getName);\n return new OrdinalMeta({\n categories: categories,\n needCollect: !categories,\n // deduplication is default in axis.\n deduplication: option.dedplication !== false\n });\n };\n\n ;\n\n OrdinalMeta.prototype.getOrdinal = function (category) {\n // @ts-ignore\n return this._getOrCreateMap().get(category);\n };\n /**\n * @return The ordinal. If not found, return NaN.\n */\n\n\n OrdinalMeta.prototype.parseAndCollect = function (category) {\n var index;\n var needCollect = this._needCollect; // The value of category dim can be the index of the given category set.\n // This feature is only supported when !needCollect, because we should\n // consider a common case: a value is 2017, which is a number but is\n // expected to be tread as a category. This case usually happen in dataset,\n // where it happent to be no need of the index feature.\n\n if (typeof category !== 'string' && !needCollect) {\n return category;\n } // Optimize for the scenario:\n // category is ['2012-01-01', '2012-01-02', ...], where the input\n // data has been ensured not duplicate and is large data.\n // Notice, if a dataset dimension provide categroies, usually echarts\n // should remove duplication except user tell echarts dont do that\n // (set axis.deduplication = false), because echarts do not know whether\n // the values in the category dimension has duplication (consider the\n // parallel-aqi example)\n\n\n if (needCollect && !this._deduplication) {\n index = this.categories.length;\n this.categories[index] = category;\n return index;\n }\n\n var map = this._getOrCreateMap(); // @ts-ignore\n\n\n index = map.get(category);\n\n if (index == null) {\n if (needCollect) {\n index = this.categories.length;\n this.categories[index] = category; // @ts-ignore\n\n map.set(category, index);\n } else {\n index = NaN;\n }\n }\n\n return index;\n }; // Consider big data, do not create map until needed.\n\n\n OrdinalMeta.prototype._getOrCreateMap = function () {\n return this._map || (this._map = createHashMap(this.categories));\n };\n\n return OrdinalMeta;\n}();\n\nfunction getName(obj) {\n if (isObject(obj) && obj.value != null) {\n return obj.value;\n } else {\n return obj + '';\n }\n}\n\nexport default OrdinalMeta;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nexport function layout(axisModel, opt) {\n opt = opt || {};\n var single = axisModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var axisPosition = axis.position;\n var orient = axis.orient;\n var rect = single.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var positionMap = {\n horizontal: {\n top: rectBound[2],\n bottom: rectBound[3]\n },\n vertical: {\n left: rectBound[0],\n right: rectBound[1]\n }\n };\n layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];\n var r = {\n horizontal: 0,\n vertical: 1\n };\n layout.rotation = Math.PI / 2 * r[orient];\n var directionMap = {\n top: -1,\n bottom: 1,\n right: 1,\n left: -1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];\n\n if (axisModel.get(['axisTick', 'inside'])) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get(['axisLabel', 'inside']))) {\n layout.labelDirection = -layout.labelDirection;\n }\n\n var labelRotation = opt.rotate;\n labelRotation == null && (labelRotation = axisModel.get(['axisLabel', 'rotate']));\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\n layout.z2 = 1;\n return layout;\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nvar defaultOption = {\n show: true,\n zlevel: 0,\n z: 0,\n // Inverse the axis.\n inverse: false,\n // Axis name displayed.\n name: '',\n // 'start' | 'middle' | 'end'\n nameLocation: 'end',\n // By degree. By default auto rotate by nameLocation.\n nameRotate: null,\n nameTruncate: {\n maxWidth: null,\n ellipsis: '...',\n placeholder: '.'\n },\n // Use global text style by default.\n nameTextStyle: {},\n // The gap between axisName and axisLine.\n nameGap: 15,\n // Default `false` to support tooltip.\n silent: false,\n // Default `false` to avoid legacy user event listener fail.\n triggerEvent: false,\n tooltip: {\n show: false\n },\n axisPointer: {},\n axisLine: {\n show: true,\n onZero: true,\n onZeroAxisIndex: null,\n lineStyle: {\n color: '#6E7079',\n width: 1,\n type: 'solid'\n },\n // The arrow at both ends the the axis.\n symbol: ['none', 'none'],\n symbolSize: [10, 15]\n },\n axisTick: {\n show: true,\n // Whether axisTick is inside the grid or outside the grid.\n inside: false,\n // The length of axisTick.\n length: 5,\n lineStyle: {\n width: 1\n }\n },\n axisLabel: {\n show: true,\n // Whether axisLabel is inside the grid or outside the grid.\n inside: false,\n rotate: 0,\n // true | false | null/undefined (auto)\n showMinLabel: null,\n // true | false | null/undefined (auto)\n showMaxLabel: null,\n margin: 8,\n // formatter: null,\n fontSize: 12\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: ['#E0E6F1'],\n width: 1,\n type: 'solid'\n }\n },\n splitArea: {\n show: false,\n areaStyle: {\n color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']\n }\n }\n};\nvar categoryAxis = zrUtil.merge({\n // The gap at both ends of the axis. For categoryAxis, boolean.\n boundaryGap: true,\n // Set false to faster category collection.\n deduplication: null,\n // splitArea: {\n // show: false\n // },\n splitLine: {\n show: false\n },\n axisTick: {\n // If tick is align with label when boundaryGap is true\n alignWithLabel: false,\n interval: 'auto'\n },\n axisLabel: {\n interval: 'auto'\n }\n}, defaultOption);\nvar valueAxis = zrUtil.merge({\n boundaryGap: [0, 0],\n axisLine: {\n // Not shown when other axis is categoryAxis in cartesian\n show: 'auto'\n },\n axisTick: {\n // Not shown when other axis is categoryAxis in cartesian\n show: 'auto'\n },\n // TODO\n // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]\n splitNumber: 5,\n minorTick: {\n // Minor tick, not available for cateogry axis.\n show: false,\n // Split number of minor ticks. The value should be in range of (0, 100)\n splitNumber: 5,\n // Lenght of minor tick\n length: 3,\n // Line style\n lineStyle: {// Default to be same with axisTick\n }\n },\n minorSplitLine: {\n show: false,\n lineStyle: {\n color: '#F4F7FD',\n width: 1\n }\n }\n}, defaultOption);\nvar timeAxis = zrUtil.merge({\n scale: true,\n splitNumber: 6,\n axisLabel: {\n // To eliminate labels that are not nice\n showMinLabel: false,\n showMaxLabel: false,\n rich: {\n primary: {\n fontWeight: 'bold'\n }\n }\n },\n splitLine: {\n show: false\n }\n}, valueAxis);\nvar logAxis = zrUtil.defaults({\n scale: true,\n logBase: 10\n}, valueAxis);\nexport default {\n category: categoryAxis,\n value: valueAxis,\n time: timeAxis,\n log: logAxis\n};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport View from '../View';\nimport geoSourceManager from './geoSourceManager';\nimport { SINGLE_REFERRING } from '../../util/model';\nvar GEO_DEFAULT_PARAMS = {\n 'geoJSON': {\n aspectScale: 0.75,\n invertLongitute: true\n },\n 'geoSVG': {\n aspectScale: 1,\n invertLongitute: false\n }\n};\nexport var geo2DDimensions = ['lng', 'lat'];\n\nvar Geo =\n/** @class */\nfunction (_super) {\n __extends(Geo, _super);\n\n function Geo(name, map, opt) {\n var _this = _super.call(this, name) || this;\n\n _this.dimensions = geo2DDimensions;\n _this.type = 'geo'; // Only store specified name coord via `addGeoCoord`.\n\n _this._nameCoordMap = zrUtil.createHashMap();\n _this.map = map;\n var source = geoSourceManager.load(map, opt.nameMap, opt.nameProperty);\n var resource = geoSourceManager.getGeoResource(map);\n _this.resourceType = resource ? resource.type : null;\n var defaultParmas = GEO_DEFAULT_PARAMS[resource.type];\n _this._regionsMap = source.regionsMap;\n _this._invertLongitute = defaultParmas.invertLongitute;\n _this.regions = source.regions;\n _this.aspectScale = zrUtil.retrieve2(opt.aspectScale, defaultParmas.aspectScale);\n var boundingRect = source.boundingRect;\n\n _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height);\n\n return _this;\n }\n /**\n * Whether contain the given [lng, lat] coord.\n */\n // Never used yet.\n // containCoord(coord: number[]) {\n // const regions = this.regions;\n // for (let i = 0; i < regions.length; i++) {\n // const region = regions[i];\n // if (region.type === 'geoJSON' && (region as GeoJSONRegion).contain(coord)) {\n // return true;\n // }\n // }\n // return false;\n // }\n\n\n Geo.prototype._transformTo = function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var invertLongitute = this._invertLongitute;\n rect = rect.clone();\n\n if (invertLongitute) {\n // Longitute is inverted\n rect.y = -rect.y - rect.height;\n }\n\n var rawTransformable = this._rawTransformable;\n rawTransformable.transform = rect.calculateTransform(new BoundingRect(x, y, width, height));\n var rawParent = rawTransformable.parent;\n rawTransformable.parent = null;\n rawTransformable.decomposeTransform();\n rawTransformable.parent = rawParent;\n\n if (invertLongitute) {\n rawTransformable.scaleY = -rawTransformable.scaleY;\n }\n\n this._updateTransform();\n };\n\n Geo.prototype.getRegion = function (name) {\n return this._regionsMap.get(name);\n };\n\n Geo.prototype.getRegionByCoord = function (coord) {\n var regions = this.regions;\n\n for (var i = 0; i < regions.length; i++) {\n var region = regions[i];\n\n if (region.type === 'geoJSON' && region.contain(coord)) {\n return regions[i];\n }\n }\n };\n /**\n * Add geoCoord for indexing by name\n */\n\n\n Geo.prototype.addGeoCoord = function (name, geoCoord) {\n this._nameCoordMap.set(name, geoCoord);\n };\n /**\n * Get geoCoord by name\n */\n\n\n Geo.prototype.getGeoCoord = function (name) {\n var region = this._regionsMap.get(name); // calcualte center only on demand.\n\n\n return this._nameCoordMap.get(name) || region && region.getCenter();\n };\n\n Geo.prototype.dataToPoint = function (data, noRoam, out) {\n if (typeof data === 'string') {\n // Map area name to geoCoord\n data = this.getGeoCoord(data);\n }\n\n if (data) {\n return View.prototype.dataToPoint.call(this, data, noRoam, out);\n }\n };\n\n Geo.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n Geo.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n\n return Geo;\n}(View);\n\n;\nzrUtil.mixin(Geo, View);\n\nfunction getCoordSys(finder) {\n var geoModel = finder.geoModel;\n var seriesModel = finder.seriesModel;\n return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem // For map series.\n || (seriesModel.getReferringComponents('geo', SINGLE_REFERRING).models[0] || {}).coordinateSystem : null;\n}\n\nexport default Geo;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport Geo, { geo2DDimensions } from './Geo';\nimport * as layout from '../../util/layout';\nimport * as numberUtil from '../../util/number';\nimport geoSourceManager from './geoSourceManager';\n/**\n * Resize method bound to the geo\n */\n\nfunction resizeGeo(geoModel, api) {\n var boundingCoords = geoModel.get('boundingCoords');\n\n if (boundingCoords != null) {\n var leftTop = boundingCoords[0];\n var rightBottom = boundingCoords[1];\n\n if (isNaN(leftTop[0]) || isNaN(leftTop[1]) || isNaN(rightBottom[0]) || isNaN(rightBottom[1])) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Invalid boundingCoords');\n }\n } else {\n this.setBoundingRect(leftTop[0], leftTop[1], rightBottom[0] - leftTop[0], rightBottom[1] - leftTop[1]);\n }\n }\n\n var rect = this.getBoundingRect();\n var centerOption = geoModel.get('layoutCenter');\n var sizeOption = geoModel.get('layoutSize');\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n var aspect = rect.width / rect.height * this.aspectScale;\n var useCenterAndSize = false;\n var center;\n var size;\n\n if (centerOption && sizeOption) {\n center = [numberUtil.parsePercent(centerOption[0], viewWidth), numberUtil.parsePercent(centerOption[1], viewHeight)];\n size = numberUtil.parsePercent(sizeOption, Math.min(viewWidth, viewHeight));\n\n if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) {\n useCenterAndSize = true;\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.');\n }\n }\n }\n\n var viewRect;\n\n if (useCenterAndSize) {\n viewRect = {};\n\n if (aspect > 1) {\n // Width is same with size\n viewRect.width = size;\n viewRect.height = size / aspect;\n } else {\n viewRect.height = size;\n viewRect.width = size * aspect;\n }\n\n viewRect.y = center[1] - viewRect.height / 2;\n viewRect.x = center[0] - viewRect.width / 2;\n } else {\n // Use left/top/width/height\n var boxLayoutOption = geoModel.getBoxLayoutParams();\n boxLayoutOption.aspect = aspect;\n viewRect = layout.getLayoutRect(boxLayoutOption, {\n width: viewWidth,\n height: viewHeight\n });\n }\n\n this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);\n this.setCenter(geoModel.get('center'));\n this.setZoom(geoModel.get('zoom'));\n} // Back compat for ECharts2, where the coord map is set on map series:\n// {type: 'map', geoCoord: {'cityA': [116.46,39.92], 'cityA': [119.12,24.61]}},\n\n\nfunction setGeoCoords(geo, model) {\n zrUtil.each(model.get('geoCoord'), function (geoCoord, name) {\n geo.addGeoCoord(name, geoCoord);\n });\n}\n\nvar GeoCreator =\n/** @class */\nfunction () {\n function GeoCreator() {\n // For deciding which dimensions to use when creating list data\n this.dimensions = geo2DDimensions;\n }\n\n GeoCreator.prototype.create = function (ecModel, api) {\n var geoList = []; // FIXME Create each time may be slow\n\n ecModel.eachComponent('geo', function (geoModel, idx) {\n var name = geoModel.get('map');\n var geo = new Geo(name + idx, name, {\n nameMap: geoModel.get('nameMap'),\n nameProperty: geoModel.get('nameProperty'),\n aspectScale: geoModel.get('aspectScale')\n });\n geo.zoomLimit = geoModel.get('scaleLimit');\n geoList.push(geo); // setGeoCoords(geo, geoModel);\n\n geoModel.coordinateSystem = geo;\n geo.model = geoModel; // Inject resize method\n\n geo.resize = resizeGeo;\n geo.resize(geoModel, api);\n });\n ecModel.eachSeries(function (seriesModel) {\n var coordSys = seriesModel.get('coordinateSystem');\n\n if (coordSys === 'geo') {\n var geoIndex = seriesModel.get('geoIndex') || 0;\n seriesModel.coordinateSystem = geoList[geoIndex];\n }\n }); // If has map series\n\n var mapModelGroupBySeries = {};\n ecModel.eachSeriesByType('map', function (seriesModel) {\n if (!seriesModel.getHostGeoModel()) {\n var mapType = seriesModel.getMapType();\n mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];\n mapModelGroupBySeries[mapType].push(seriesModel);\n }\n });\n zrUtil.each(mapModelGroupBySeries, function (mapSeries, mapType) {\n var nameMapList = zrUtil.map(mapSeries, function (singleMapSeries) {\n return singleMapSeries.get('nameMap');\n });\n var geo = new Geo(mapType, mapType, {\n nameMap: zrUtil.mergeAll(nameMapList),\n nameProperty: mapSeries[0].get('nameProperty'),\n aspectScale: mapSeries[0].get('aspectScale')\n });\n geo.zoomLimit = zrUtil.retrieve.apply(null, zrUtil.map(mapSeries, function (singleMapSeries) {\n return singleMapSeries.get('scaleLimit');\n }));\n geoList.push(geo); // Inject resize method\n\n geo.resize = resizeGeo;\n geo.resize(mapSeries[0], api);\n zrUtil.each(mapSeries, function (singleMapSeries) {\n singleMapSeries.coordinateSystem = geo;\n setGeoCoords(geo, singleMapSeries);\n });\n });\n return geoList;\n };\n /**\n * Fill given regions array\n */\n\n\n GeoCreator.prototype.getFilledRegions = function (originRegionArr, mapName, nameMap, nameProperty) {\n // Not use the original\n var regionsArr = (originRegionArr || []).slice();\n var dataNameMap = zrUtil.createHashMap();\n\n for (var i = 0; i < regionsArr.length; i++) {\n dataNameMap.set(regionsArr[i].name, regionsArr[i]);\n }\n\n var source = geoSourceManager.load(mapName, nameMap, nameProperty);\n zrUtil.each(source.regions, function (region) {\n var name = region.name;\n !dataNameMap.get(name) && regionsArr.push({\n name: name\n });\n });\n return regionsArr;\n };\n\n return GeoCreator;\n}();\n\nvar geoCreator = new GeoCreator();\nexport default geoCreator;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin';\nimport { mixin } from 'zrender/lib/core/util';\n\nvar SingleAxisModel =\n/** @class */\nfunction (_super) {\n __extends(SingleAxisModel, _super);\n\n function SingleAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = SingleAxisModel.type;\n return _this;\n }\n\n SingleAxisModel.prototype.getCoordSysModel = function () {\n return this;\n };\n\n SingleAxisModel.type = 'singleAxis';\n SingleAxisModel.layoutMode = 'box';\n SingleAxisModel.defaultOption = {\n left: '5%',\n top: '5%',\n right: '5%',\n bottom: '5%',\n type: 'value',\n position: 'bottom',\n orient: 'horizontal',\n axisLine: {\n show: true,\n lineStyle: {\n width: 1,\n type: 'solid'\n }\n },\n // Single coordinate system and single axis is the,\n // which is used as the parent tooltip model.\n // same model, so we set default tooltip show as true.\n tooltip: {\n show: true\n },\n axisTick: {\n show: true,\n length: 6,\n lineStyle: {\n width: 1\n }\n },\n axisLabel: {\n show: true,\n interval: 'auto'\n },\n splitLine: {\n show: true,\n lineStyle: {\n type: 'dashed',\n opacity: 0.2\n }\n }\n };\n return SingleAxisModel;\n}(ComponentModel);\n\nmixin(SingleAxisModel, AxisModelCommonMixin.prototype);\nexport default SingleAxisModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ComponentModel from '../../model/Component';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin';\nimport { SINGLE_REFERRING } from '../../util/model';\n\nvar CartesianAxisModel =\n/** @class */\nfunction (_super) {\n __extends(CartesianAxisModel, _super);\n\n function CartesianAxisModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n CartesianAxisModel.prototype.getCoordSysModel = function () {\n return this.getReferringComponents('grid', SINGLE_REFERRING).models[0];\n };\n\n CartesianAxisModel.type = 'cartesian2dAxis';\n return CartesianAxisModel;\n}(ComponentModel);\n\nexport { CartesianAxisModel };\nzrUtil.mixin(CartesianAxisModel, AxisModelCommonMixin);\nexport default CartesianAxisModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ComponentModel from '../../model/Component';\nimport makeStyleMapper from '../../model/mixin/makeStyleMapper';\nimport * as numberUtil from '../../util/number';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin';\n\nvar ParallelAxisModel =\n/** @class */\nfunction (_super) {\n __extends(ParallelAxisModel, _super);\n\n function ParallelAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelAxisModel.type;\n /**\n * @readOnly\n */\n\n _this.activeIntervals = [];\n return _this;\n }\n\n ParallelAxisModel.prototype.getAreaSelectStyle = function () {\n return makeStyleMapper([['fill', 'color'], ['lineWidth', 'borderWidth'], ['stroke', 'borderColor'], ['width', 'width'], ['opacity', 'opacity'] // Option decal is in `DecalObject` but style.decal is in `PatternObject`.\n // So do not transfer decal directly.\n ])(this.getModel('areaSelectStyle'));\n };\n /**\n * The code of this feature is put on AxisModel but not ParallelAxis,\n * because axisModel can be alive after echarts updating but instance of\n * ParallelAxis having been disposed. this._activeInterval should be kept\n * when action dispatched (i.e. legend click).\n *\n * @param intervals `interval.length === 0` means set all active.\n */\n\n\n ParallelAxisModel.prototype.setActiveIntervals = function (intervals) {\n var activeIntervals = this.activeIntervals = zrUtil.clone(intervals); // Normalize\n\n if (activeIntervals) {\n for (var i = activeIntervals.length - 1; i >= 0; i--) {\n numberUtil.asc(activeIntervals[i]);\n }\n }\n };\n /**\n * @param value When only attempting detect whether 'no activeIntervals set',\n * `value` is not needed to be input.\n */\n\n\n ParallelAxisModel.prototype.getActiveState = function (value) {\n var activeIntervals = this.activeIntervals;\n\n if (!activeIntervals.length) {\n return 'normal';\n }\n\n if (value == null || isNaN(+value)) {\n return 'inactive';\n } // Simple optimization\n\n\n if (activeIntervals.length === 1) {\n var interval = activeIntervals[0];\n\n if (interval[0] <= value && value <= interval[1]) {\n return 'active';\n }\n } else {\n for (var i = 0, len = activeIntervals.length; i < len; i++) {\n if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {\n return 'active';\n }\n }\n }\n\n return 'inactive';\n };\n\n return ParallelAxisModel;\n}(ComponentModel);\n\nzrUtil.mixin(ParallelAxisModel, AxisModelCommonMixin);\nexport default ParallelAxisModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ComponentModel from '../../model/Component';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin';\nimport { SINGLE_REFERRING } from '../../util/model';\n\nvar PolarAxisModel =\n/** @class */\nfunction (_super) {\n __extends(PolarAxisModel, _super);\n\n function PolarAxisModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n PolarAxisModel.prototype.getCoordSysModel = function () {\n return this.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n };\n\n PolarAxisModel.type = 'polarAxis';\n return PolarAxisModel;\n}(ComponentModel);\n\nzrUtil.mixin(PolarAxisModel, AxisModelCommonMixin);\nexport { PolarAxisModel };\n\nvar AngleAxisModel =\n/** @class */\nfunction (_super) {\n __extends(AngleAxisModel, _super);\n\n function AngleAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = AngleAxisModel.type;\n return _this;\n }\n\n AngleAxisModel.type = 'angleAxis';\n return AngleAxisModel;\n}(PolarAxisModel);\n\nexport { AngleAxisModel };\n\nvar RadiusAxisModel =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxisModel, _super);\n\n function RadiusAxisModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadiusAxisModel.type;\n return _this;\n }\n\n RadiusAxisModel.type = 'radiusAxis';\n return RadiusAxisModel;\n}(PolarAxisModel);\n\nexport { RadiusAxisModel };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport OrdinalScale from '../scale/Ordinal';\nimport IntervalScale from '../scale/Interval';\nimport Scale from '../scale/Scale';\nimport { prepareLayoutBarSeries, makeColumnLayout, retrieveColumnLayout } from '../layout/barGrid';\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport TimeScale from '../scale/Time';\nimport LogScale from '../scale/Log';\nimport { getStackedDimension } from '../data/helper/dataStackHelper';\nimport { ensureScaleRawExtentInfo } from './scaleRawExtentInfo';\n/**\n * Get axis scale extent before niced.\n * Item of returned array can only be number (including Infinity and NaN).\n *\n * Caution:\n * Precondition of calling this method:\n * The scale extent has been initialized using series data extent via\n * `scale.setExtent` or `scale.unionExtentFromData`;\n */\n\nexport function getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var rawExtentResult = ensureScaleRawExtentInfo(scale, model, scale.getExtent()).calculate();\n scale.setBlank(rawExtentResult.isBlank);\n var min = rawExtentResult.min;\n var max = rawExtentResult.max; // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis\n // is base axis\n // FIXME\n // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly.\n // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent?\n // Should not depend on series type `bar`?\n // (3) Fix that might overlap when using dataZoom.\n // (4) Consider other chart types using `barGrid`?\n // See #6728, #4862, `test/bar-overflow-time-plot.html`\n\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /*|| scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries_1 = false;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries_1) {\n // Calculate placement of bars on axis. TODO should be decoupled\n // with barLayout\n var barWidthAndOffset = makeColumnLayout(barSeriesModels); // Adjust axis min and max to account for overflow\n\n var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset);\n min = adjustedScale.min;\n max = adjustedScale.max;\n }\n }\n\n return {\n extent: [min, max],\n // \"fix\" means \"fixed\", the value should not be\n // changed in the subsequent steps.\n fixMin: rawExtentResult.minFixed,\n fixMax: rawExtentResult.maxFixed\n };\n}\n\nfunction adjustScaleForOverflow(min, max, model, // Only support cartesian coord yet.\nbarWidthAndOffset) {\n // Get Axis Length\n var axisExtent = model.axis.getExtent();\n var axisLength = axisExtent[1] - axisExtent[0]; // Get bars on current base axis and calculate min and max overflow\n\n var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);\n\n if (barsOnCurrentAxis === undefined) {\n return {\n min: min,\n max: max\n };\n }\n\n var minOverflow = Infinity;\n zrUtil.each(barsOnCurrentAxis, function (item) {\n minOverflow = Math.min(item.offset, minOverflow);\n });\n var maxOverflow = -Infinity;\n zrUtil.each(barsOnCurrentAxis, function (item) {\n maxOverflow = Math.max(item.offset + item.width, maxOverflow);\n });\n minOverflow = Math.abs(minOverflow);\n maxOverflow = Math.abs(maxOverflow);\n var totalOverFlow = minOverflow + maxOverflow; // Calculate required buffer based on old range and overflow\n\n var oldRange = max - min;\n var oldRangePercentOfNew = 1 - (minOverflow + maxOverflow) / axisLength;\n var overflowBuffer = oldRange / oldRangePercentOfNew - oldRange;\n max += overflowBuffer * (maxOverflow / totalOverFlow);\n min -= overflowBuffer * (minOverflow / totalOverFlow);\n return {\n min: min,\n max: max\n };\n} // Precondition of calling this method:\n// The scale extent has been initailized using series data extent via\n// `scale.setExtent` or `scale.unionExtentFromData`;\n\n\nexport function niceScaleExtent(scale, model) {\n var extentInfo = getScaleExtent(scale, model);\n var extent = extentInfo.extent;\n var splitNumber = model.get('splitNumber');\n\n if (scale instanceof LogScale) {\n scale.base = model.get('logBase');\n }\n\n var scaleType = scale.type;\n scale.setExtent(extent[0], extent[1]);\n scale.niceExtent({\n splitNumber: splitNumber,\n fixMin: extentInfo.fixMin,\n fixMax: extentInfo.fixMax,\n minInterval: scaleType === 'interval' || scaleType === 'time' ? model.get('minInterval') : null,\n maxInterval: scaleType === 'interval' || scaleType === 'time' ? model.get('maxInterval') : null\n }); // If some one specified the min, max. And the default calculated interval\n // is not good enough. He can specify the interval. It is often appeared\n // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard\n // to be 60.\n // FIXME\n\n var interval = model.get('interval');\n\n if (interval != null) {\n scale.setInterval && scale.setInterval(interval);\n }\n}\n/**\n * @param axisType Default retrieve from model.type\n */\n\nexport function createScaleByModel(model, axisType) {\n axisType = axisType || model.get('type');\n\n if (axisType) {\n switch (axisType) {\n // Buildin scale\n case 'category':\n return new OrdinalScale({\n ordinalMeta: model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(),\n extent: [Infinity, -Infinity]\n });\n\n case 'time':\n return new TimeScale({\n locale: model.ecModel.getLocaleModel(),\n useUTC: model.ecModel.get('useUTC')\n });\n\n default:\n // case 'value'/'interval', 'log', or others.\n return new (Scale.getClass(axisType) || IntervalScale)();\n }\n }\n}\n/**\n * Check if the axis cross 0\n */\n\nexport function ifAxisCrossZero(axis) {\n var dataExtent = axis.scale.getExtent();\n var min = dataExtent[0];\n var max = dataExtent[1];\n return !(min > 0 && max > 0 || min < 0 && max < 0);\n}\n/**\n * @param axis\n * @return Label formatter function.\n * param: {number} tickValue,\n * param: {number} idx, the index in all ticks.\n * If category axis, this param is not required.\n * return: {string} label string.\n */\n\nexport function makeLabelFormatter(axis) {\n var labelFormatter = axis.getLabelModel().get('formatter');\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\n\n if (axis.scale.type === 'time') {\n return function (tpl) {\n return function (tick, idx) {\n return axis.scale.getFormattedLabel(tick, idx, tpl);\n };\n }(labelFormatter);\n } else if (typeof labelFormatter === 'string') {\n return function (tpl) {\n return function (tick) {\n // For category axis, get raw value; for numeric axis,\n // get formatted label like '1,333,444'.\n var label = axis.scale.getLabel(tick);\n var text = tpl.replace('{value}', label != null ? label : '');\n return text;\n };\n }(labelFormatter);\n } else if (typeof labelFormatter === 'function') {\n return function (cb) {\n return function (tick, idx) {\n // The original intention of `idx` is \"the index of the tick in all ticks\".\n // But the previous implementation of category axis do not consider the\n // `axisLabel.interval`, which cause that, for example, the `interval` is\n // `1`, then the ticks \"name5\", \"name7\", \"name9\" are displayed, where the\n // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep\n // the definition here for back compatibility.\n if (categoryTickStart != null) {\n idx = tick.value - categoryTickStart;\n }\n\n return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {\n level: tick.level\n } : null);\n };\n }(labelFormatter);\n } else {\n return function (tick) {\n return axis.scale.getLabel(tick);\n };\n }\n}\nexport function getAxisRawValue(axis, tick) {\n // In category axis with data zoom, tick is not the original\n // index of axis.data. So tick should not be exposed to user\n // in category axis.\n return axis.type === 'category' ? axis.scale.getLabel(tick) : tick.value;\n}\n/**\n * @param axis\n * @return Be null/undefined if no labels.\n */\n\nexport function estimateLabelUnionRect(axis) {\n var axisModel = axis.model;\n var scale = axis.scale;\n\n if (!axisModel.get(['axisLabel', 'show']) || scale.isBlank()) {\n return;\n }\n\n var realNumberScaleTicks;\n var tickCount;\n var categoryScaleExtent = scale.getExtent(); // Optimize for large category data, avoid call `getTicks()`.\n\n if (scale instanceof OrdinalScale) {\n tickCount = scale.count();\n } else {\n realNumberScaleTicks = scale.getTicks();\n tickCount = realNumberScaleTicks.length;\n }\n\n var axisLabelModel = axis.getLabelModel();\n var labelFormatter = makeLabelFormatter(axis);\n var rect;\n var step = 1; // Simple optimization for large amount of labels\n\n if (tickCount > 40) {\n step = Math.ceil(tickCount / 40);\n }\n\n for (var i = 0; i < tickCount; i += step) {\n var tick = realNumberScaleTicks ? realNumberScaleTicks[i] : {\n value: categoryScaleExtent[0] + i\n };\n var label = labelFormatter(tick, i);\n var unrotatedSingleRect = axisLabelModel.getTextRect(label);\n var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0);\n rect ? rect.union(singleRect) : rect = singleRect;\n }\n\n return rect;\n}\n\nfunction rotateTextRect(textRect, rotate) {\n var rotateRadians = rotate * Math.PI / 180;\n var beforeWidth = textRect.width;\n var beforeHeight = textRect.height;\n var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians));\n var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians));\n var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);\n return rotatedRect;\n}\n/**\n * @param model axisLabelModel or axisTickModel\n * @return {number|String} Can be null|'auto'|number|function\n */\n\n\nexport function getOptionCategoryInterval(model) {\n var interval = model.get('interval');\n return interval == null ? 'auto' : interval;\n}\n/**\n * Set `categoryInterval` as 0 implicitly indicates that\n * show all labels reguardless of overlap.\n * @param {Object} axis axisModel.axis\n */\n\nexport function shouldShowAllLabels(axis) {\n return axis.type === 'category' && getOptionCategoryInterval(axis.getLabelModel()) === 0;\n}\nexport function getDataDimensionsOnAxis(data, axisDim) {\n // Remove duplicated dat dimensions caused by `getStackedDimension`.\n var dataDimMap = {}; // Currently `mapDimensionsAll` will contain stack result dimension ('__\\0ecstackresult').\n // PENDING: is it reasonable? Do we need to remove the original dim from \"coord dim\" since\n // there has been stacked result dim?\n\n zrUtil.each(data.mapDimensionsAll(axisDim), function (dataDim) {\n // For example, the extent of the original dimension\n // is [0.1, 0.5], the extent of the `stackResultDimension`\n // is [7, 9], the final extent should NOT include [0.1, 0.5],\n // because there is no graphic corresponding to [0.1, 0.5].\n // See the case in `test/area-stack.html` `main1`, where area line\n // stack needs `yAxis` not start from 0.\n dataDimMap[getStackedDimension(data, dataDim)] = true;\n });\n return zrUtil.keys(dataDimMap);\n}\nexport function unionAxisExtentFromData(dataExtent, data, axisDim) {\n if (data) {\n zrUtil.each(getDataDimensionsOnAxis(data, axisDim), function (dim) {\n var seriesExtent = data.getApproximateExtent(dim);\n seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);\n seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);\n });\n }\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component';\n\nvar GridModel =\n/** @class */\nfunction (_super) {\n __extends(GridModel, _super);\n\n function GridModel() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n GridModel.type = 'grid';\n GridModel.dependencies = ['xAxis', 'yAxis'];\n GridModel.layoutMode = 'box';\n GridModel.defaultOption = {\n show: false,\n zlevel: 0,\n z: 0,\n left: '10%',\n top: 60,\n right: '10%',\n bottom: 70,\n // If grid size contain label\n containLabel: false,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n backgroundColor: 'rgba(0,0,0,0)',\n borderWidth: 1,\n borderColor: '#ccc'\n };\n return GridModel;\n}(ComponentModel);\n\nexport default GridModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport axisDefault from '../axisDefault';\nimport Model from '../../model/Model';\nimport { AxisModelCommonMixin } from '../axisModelCommonMixin';\nimport ComponentModel from '../../model/Component';\nvar valueAxisDefault = axisDefault.value;\n\nfunction defaultsShow(opt, show) {\n return zrUtil.defaults({\n show: show\n }, opt);\n}\n\nvar RadarModel =\n/** @class */\nfunction (_super) {\n __extends(RadarModel, _super);\n\n function RadarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = RadarModel.type;\n return _this;\n }\n\n RadarModel.prototype.optionUpdated = function () {\n var boundaryGap = this.get('boundaryGap');\n var splitNumber = this.get('splitNumber');\n var scale = this.get('scale');\n var axisLine = this.get('axisLine');\n var axisTick = this.get('axisTick'); // let axisType = this.get('axisType');\n\n var axisLabel = this.get('axisLabel');\n var nameTextStyle = this.get('axisName');\n var showName = this.get(['axisName', 'show']);\n var nameFormatter = this.get(['axisName', 'formatter']);\n var nameGap = this.get('axisNameGap');\n var triggerEvent = this.get('triggerEvent');\n var indicatorModels = zrUtil.map(this.get('indicator') || [], function (indicatorOpt) {\n // PENDING\n if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {\n indicatorOpt.min = 0;\n } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {\n indicatorOpt.max = 0;\n }\n\n var iNameTextStyle = nameTextStyle;\n\n if (indicatorOpt.color != null) {\n iNameTextStyle = zrUtil.defaults({\n color: indicatorOpt.color\n }, nameTextStyle);\n } // Use same configuration\n\n\n var innerIndicatorOpt = zrUtil.merge(zrUtil.clone(indicatorOpt), {\n boundaryGap: boundaryGap,\n splitNumber: splitNumber,\n scale: scale,\n axisLine: axisLine,\n axisTick: axisTick,\n // axisType: axisType,\n axisLabel: axisLabel,\n // Compatible with 2 and use text\n name: indicatorOpt.text,\n nameLocation: 'end',\n nameGap: nameGap,\n // min: 0,\n nameTextStyle: iNameTextStyle,\n triggerEvent: triggerEvent\n }, false);\n\n if (!showName) {\n innerIndicatorOpt.name = '';\n }\n\n if (typeof nameFormatter === 'string') {\n var indName = innerIndicatorOpt.name;\n innerIndicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : '');\n } else if (typeof nameFormatter === 'function') {\n innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt);\n }\n\n var model = new Model(innerIndicatorOpt, null, this.ecModel);\n zrUtil.mixin(model, AxisModelCommonMixin.prototype); // For triggerEvent.\n\n model.mainType = 'radar';\n model.componentIndex = this.componentIndex;\n return model;\n }, this);\n this._indicatorModels = indicatorModels;\n };\n\n RadarModel.prototype.getIndicatorModels = function () {\n return this._indicatorModels;\n };\n\n RadarModel.type = 'radar';\n RadarModel.defaultOption = {\n zlevel: 0,\n z: 0,\n center: ['50%', '50%'],\n radius: '75%',\n startAngle: 90,\n axisName: {\n show: true // formatter: null\n // textStyle: {}\n\n },\n boundaryGap: [0, 0],\n splitNumber: 5,\n axisNameGap: 15,\n scale: false,\n // Polygon or circle\n shape: 'polygon',\n axisLine: zrUtil.merge({\n lineStyle: {\n color: '#bbb'\n }\n }, valueAxisDefault.axisLine),\n axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),\n axisTick: defaultsShow(valueAxisDefault.axisTick, false),\n // axisType: 'value',\n splitLine: defaultsShow(valueAxisDefault.splitLine, true),\n splitArea: defaultsShow(valueAxisDefault.splitArea, true),\n // {text, min, max}\n indicator: []\n };\n return RadarModel;\n}(ComponentModel);\n\nexport default RadarModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as modelUtil from '../../util/model';\nimport ComponentModel from '../../model/Component';\nimport Model from '../../model/Model';\nimport geoCreator from './geoCreator';\nimport geoSourceManager from './geoSourceManager';\n;\n\nvar GeoModel =\n/** @class */\nfunction (_super) {\n __extends(GeoModel, _super);\n\n function GeoModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = GeoModel.type;\n return _this;\n }\n\n GeoModel.prototype.init = function (option, parentModel, ecModel) {\n var source = geoSourceManager.getGeoResource(option.map);\n\n if (source && source.type === 'geoJSON') {\n var itemStyle = option.itemStyle = option.itemStyle || {};\n\n if (!('color' in itemStyle)) {\n itemStyle.color = '#eee';\n }\n }\n\n this.mergeDefaultAndTheme(option, ecModel); // Default label emphasis `show`\n\n modelUtil.defaultEmphasis(option, 'label', ['show']);\n };\n\n GeoModel.prototype.optionUpdated = function () {\n var _this = this;\n\n var option = this.option;\n option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap, option.nameProperty);\n var selectedMap = {};\n this._optionModelMap = zrUtil.reduce(option.regions || [], function (optionModelMap, regionOpt) {\n var regionName = regionOpt.name;\n\n if (regionName) {\n optionModelMap.set(regionName, new Model(regionOpt, _this, _this.ecModel));\n\n if (regionOpt.selected) {\n selectedMap[regionName] = true;\n }\n }\n\n return optionModelMap;\n }, zrUtil.createHashMap());\n\n if (!option.selectedMap) {\n option.selectedMap = selectedMap;\n }\n };\n /**\n * Get model of region.\n */\n\n\n GeoModel.prototype.getRegionModel = function (name) {\n return this._optionModelMap.get(name) || new Model(null, this, this.ecModel);\n };\n /**\n * Format label\n * @param name Region name\n */\n\n\n GeoModel.prototype.getFormattedLabel = function (name, status) {\n var regionModel = this.getRegionModel(name);\n var formatter = status === 'normal' ? regionModel.get(['label', 'formatter']) : regionModel.get(['emphasis', 'label', 'formatter']);\n var params = {\n name: name\n };\n\n if (typeof formatter === 'function') {\n params.status = status;\n return formatter(params);\n } else if (typeof formatter === 'string') {\n return formatter.replace('{a}', name != null ? name : '');\n }\n };\n\n GeoModel.prototype.setZoom = function (zoom) {\n this.option.zoom = zoom;\n };\n\n GeoModel.prototype.setCenter = function (center) {\n this.option.center = center;\n }; // PENGING If selectedMode is null ?\n\n\n GeoModel.prototype.select = function (name) {\n var option = this.option;\n var selectedMode = option.selectedMode;\n\n if (!selectedMode) {\n return;\n }\n\n if (selectedMode !== 'multiple') {\n option.selectedMap = null;\n }\n\n var selectedMap = option.selectedMap || (option.selectedMap = {});\n selectedMap[name] = true;\n };\n\n GeoModel.prototype.unSelect = function (name) {\n var selectedMap = this.option.selectedMap;\n\n if (selectedMap) {\n selectedMap[name] = false;\n }\n };\n\n GeoModel.prototype.toggleSelected = function (name) {\n this[this.isSelected(name) ? 'unSelect' : 'select'](name);\n };\n\n GeoModel.prototype.isSelected = function (name) {\n var selectedMap = this.option.selectedMap;\n return !!(selectedMap && selectedMap[name]);\n };\n\n GeoModel.type = 'geo';\n GeoModel.layoutMode = 'box';\n GeoModel.defaultOption = {\n zlevel: 0,\n z: 0,\n show: true,\n left: 'center',\n top: 'center',\n // Default value:\n // for geoSVG source: 1,\n // for geoJSON source: 0.75.\n aspectScale: null,\n ///// Layout with center and size\n // If you wan't to put map in a fixed size box with right aspect ratio\n // This two properties may more conveninet\n // layoutCenter: [50%, 50%]\n // layoutSize: 100\n silent: false,\n // Map type\n map: '',\n // Define left-top, right-bottom coords to control view\n // For example, [ [180, 90], [-180, -90] ]\n boundingCoords: null,\n // Default on center of map\n center: null,\n zoom: 1,\n scaleLimit: null,\n // selectedMode: false\n label: {\n show: false,\n color: '#000'\n },\n itemStyle: {\n borderWidth: 0.5,\n borderColor: '#444' // Default color:\n // + geoJSON: #eee\n // + geoSVG: null (use SVG original `fill`)\n // color: '#eee'\n\n },\n emphasis: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n select: {\n label: {\n show: true,\n color: 'rgb(100,0,0)'\n },\n itemStyle: {\n color: 'rgba(255,215,0,0.8)'\n }\n },\n regions: [] // tooltip: {\n // show: false\n // }\n\n };\n return GeoModel;\n}(ComponentModel);\n\nexport default GeoModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util'; // id may be function name of Object, add a prefix to avoid this problem.\n\nfunction generateNodeKey(id) {\n return '_EC_' + id;\n}\n\nvar Graph =\n/** @class */\nfunction () {\n function Graph(directed) {\n this.type = 'graph';\n this.nodes = [];\n this.edges = [];\n this._nodesMap = {};\n /**\n * @type {Object.}\n * @private\n */\n\n this._edgesMap = {};\n this._directed = directed || false;\n }\n /**\n * If is directed graph\n */\n\n\n Graph.prototype.isDirected = function () {\n return this._directed;\n };\n\n ;\n /**\n * Add a new node\n */\n\n Graph.prototype.addNode = function (id, dataIndex) {\n id = id == null ? '' + dataIndex : '' + id;\n var nodesMap = this._nodesMap;\n\n if (nodesMap[generateNodeKey(id)]) {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Graph nodes have duplicate name or id');\n }\n\n return;\n }\n\n var node = new GraphNode(id, dataIndex);\n node.hostGraph = this;\n this.nodes.push(node);\n nodesMap[generateNodeKey(id)] = node;\n return node;\n };\n\n ;\n /**\n * Get node by data index\n */\n\n Graph.prototype.getNodeByIndex = function (dataIndex) {\n var rawIdx = this.data.getRawIndex(dataIndex);\n return this.nodes[rawIdx];\n };\n\n ;\n /**\n * Get node by id\n */\n\n Graph.prototype.getNodeById = function (id) {\n return this._nodesMap[generateNodeKey(id)];\n };\n\n ;\n /**\n * Add a new edge\n */\n\n Graph.prototype.addEdge = function (n1, n2, dataIndex) {\n var nodesMap = this._nodesMap;\n var edgesMap = this._edgesMap; // PNEDING\n\n if (typeof n1 === 'number') {\n n1 = this.nodes[n1];\n }\n\n if (typeof n2 === 'number') {\n n2 = this.nodes[n2];\n }\n\n if (!(n1 instanceof GraphNode)) {\n n1 = nodesMap[generateNodeKey(n1)];\n }\n\n if (!(n2 instanceof GraphNode)) {\n n2 = nodesMap[generateNodeKey(n2)];\n }\n\n if (!n1 || !n2) {\n return;\n }\n\n var key = n1.id + '-' + n2.id;\n var edge = new GraphEdge(n1, n2, dataIndex);\n edge.hostGraph = this;\n\n if (this._directed) {\n n1.outEdges.push(edge);\n n2.inEdges.push(edge);\n }\n\n n1.edges.push(edge);\n\n if (n1 !== n2) {\n n2.edges.push(edge);\n }\n\n this.edges.push(edge);\n edgesMap[key] = edge;\n return edge;\n };\n\n ;\n /**\n * Get edge by data index\n */\n\n Graph.prototype.getEdgeByIndex = function (dataIndex) {\n var rawIdx = this.edgeData.getRawIndex(dataIndex);\n return this.edges[rawIdx];\n };\n\n ;\n /**\n * Get edge by two linked nodes\n */\n\n Graph.prototype.getEdge = function (n1, n2) {\n if (n1 instanceof GraphNode) {\n n1 = n1.id;\n }\n\n if (n2 instanceof GraphNode) {\n n2 = n2.id;\n }\n\n var edgesMap = this._edgesMap;\n\n if (this._directed) {\n return edgesMap[n1 + '-' + n2];\n } else {\n return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1];\n }\n };\n\n ;\n /**\n * Iterate all nodes\n */\n\n Graph.prototype.eachNode = function (cb, context) {\n var nodes = this.nodes;\n var len = nodes.length;\n\n for (var i = 0; i < len; i++) {\n if (nodes[i].dataIndex >= 0) {\n cb.call(context, nodes[i], i);\n }\n }\n };\n\n ;\n /**\n * Iterate all edges\n */\n\n Graph.prototype.eachEdge = function (cb, context) {\n var edges = this.edges;\n var len = edges.length;\n\n for (var i = 0; i < len; i++) {\n if (edges[i].dataIndex >= 0 && edges[i].node1.dataIndex >= 0 && edges[i].node2.dataIndex >= 0) {\n cb.call(context, edges[i], i);\n }\n }\n };\n\n ;\n /**\n * Breadth first traverse\n * Return true to stop traversing\n */\n\n Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) {\n if (!(startNode instanceof GraphNode)) {\n startNode = this._nodesMap[generateNodeKey(startNode)];\n }\n\n if (!startNode) {\n return;\n }\n\n var edgeType = direction === 'out' ? 'outEdges' : direction === 'in' ? 'inEdges' : 'edges';\n\n for (var i = 0; i < this.nodes.length; i++) {\n this.nodes[i].__visited = false;\n }\n\n if (cb.call(context, startNode, null)) {\n return;\n }\n\n var queue = [startNode];\n\n while (queue.length) {\n var currentNode = queue.shift();\n var edges = currentNode[edgeType];\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n var otherNode = e.node1 === currentNode ? e.node2 : e.node1;\n\n if (!otherNode.__visited) {\n if (cb.call(context, otherNode, currentNode)) {\n // Stop traversing\n return;\n }\n\n queue.push(otherNode);\n otherNode.__visited = true;\n }\n }\n }\n };\n\n ; // TODO\n // depthFirstTraverse(\n // cb, startNode, direction, context\n // ) {\n // };\n // Filter update\n\n Graph.prototype.update = function () {\n var data = this.data;\n var edgeData = this.edgeData;\n var nodes = this.nodes;\n var edges = this.edges;\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n nodes[i].dataIndex = -1;\n }\n\n for (var i = 0, len = data.count(); i < len; i++) {\n nodes[data.getRawIndex(i)].dataIndex = i;\n }\n\n edgeData.filterSelf(function (idx) {\n var edge = edges[edgeData.getRawIndex(idx)];\n return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;\n }); // Update edge\n\n for (var i = 0, len = edges.length; i < len; i++) {\n edges[i].dataIndex = -1;\n }\n\n for (var i = 0, len = edgeData.count(); i < len; i++) {\n edges[edgeData.getRawIndex(i)].dataIndex = i;\n }\n };\n\n ;\n /**\n * @return {module:echarts/data/Graph}\n */\n\n Graph.prototype.clone = function () {\n var graph = new Graph(this._directed);\n var nodes = this.nodes;\n var edges = this.edges;\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(nodes[i].id, nodes[i].dataIndex);\n }\n\n for (var i = 0; i < edges.length; i++) {\n var e = edges[i];\n graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);\n }\n\n return graph;\n };\n\n ;\n return Graph;\n}();\n\nvar GraphNode =\n/** @class */\nfunction () {\n function GraphNode(id, dataIndex) {\n this.inEdges = [];\n this.outEdges = [];\n this.edges = [];\n this.dataIndex = -1;\n this.id = id == null ? '' : id;\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\n }\n /**\n * @return {number}\n */\n\n\n GraphNode.prototype.degree = function () {\n return this.edges.length;\n };\n /**\n * @return {number}\n */\n\n\n GraphNode.prototype.inDegree = function () {\n return this.inEdges.length;\n };\n /**\n * @return {number}\n */\n\n\n GraphNode.prototype.outDegree = function () {\n return this.outEdges.length;\n };\n\n GraphNode.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var graph = this.hostGraph;\n var itemModel = graph.data.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n\n GraphNode.prototype.getAdjacentDataIndices = function () {\n var dataIndices = {\n edge: [],\n node: []\n };\n\n for (var i = 0; i < this.edges.length; i++) {\n var adjacentEdge = this.edges[i];\n\n if (adjacentEdge.dataIndex < 0) {\n continue;\n }\n\n dataIndices.edge.push(adjacentEdge.dataIndex);\n dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);\n }\n\n return dataIndices;\n };\n\n return GraphNode;\n}();\n\nvar GraphEdge =\n/** @class */\nfunction () {\n function GraphEdge(n1, n2, dataIndex) {\n this.dataIndex = -1;\n this.node1 = n1;\n this.node2 = n2;\n this.dataIndex = dataIndex == null ? -1 : dataIndex;\n } // eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n\n GraphEdge.prototype.getModel = function (path) {\n if (this.dataIndex < 0) {\n return;\n }\n\n var graph = this.hostGraph;\n var itemModel = graph.edgeData.getItemModel(this.dataIndex);\n return itemModel.getModel(path);\n };\n\n GraphEdge.prototype.getAdjacentDataIndices = function () {\n return {\n edge: [this.dataIndex],\n node: [this.node1.dataIndex, this.node2.dataIndex]\n };\n };\n\n return GraphEdge;\n}();\n\nfunction createGraphDataProxyMixin(hostName, dataName) {\n return {\n /**\n * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.\n */\n getValue: function (dimension) {\n var data = this[hostName][dataName];\n return data.getStore().get(data.getDimensionIndex(dimension || 'value'), this.dataIndex);\n },\n // TODO: TYPE stricter type.\n setVisual: function (key, value) {\n this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);\n },\n getVisual: function (key) {\n return this[hostName][dataName].getItemVisual(this.dataIndex, key);\n },\n setLayout: function (layout, merge) {\n this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);\n },\n getLayout: function () {\n return this[hostName][dataName].getItemLayout(this.dataIndex);\n },\n getGraphicEl: function () {\n return this[hostName][dataName].getItemGraphicEl(this.dataIndex);\n },\n getRawIndex: function () {\n return this[hostName][dataName].getRawIndex(this.dataIndex);\n }\n };\n}\n\n;\n;\n;\nzrUtil.mixin(GraphNode, createGraphDataProxyMixin('hostGraph', 'data'));\nzrUtil.mixin(GraphEdge, createGraphDataProxyMixin('hostGraph', 'edgeData'));\nexport default Graph;\nexport { GraphNode, GraphEdge };","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ComponentModel from '../../model/Component';\n\nvar ParallelModel =\n/** @class */\nfunction (_super) {\n __extends(ParallelModel, _super);\n\n function ParallelModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = ParallelModel.type;\n return _this;\n }\n\n ParallelModel.prototype.init = function () {\n _super.prototype.init.apply(this, arguments);\n\n this.mergeOption({});\n };\n\n ParallelModel.prototype.mergeOption = function (newOption) {\n var thisOption = this.option;\n newOption && zrUtil.merge(thisOption, newOption, true);\n\n this._initDimensions();\n };\n /**\n * Whether series or axis is in this coordinate system.\n */\n\n\n ParallelModel.prototype.contains = function (model, ecModel) {\n var parallelIndex = model.get('parallelIndex');\n return parallelIndex != null && ecModel.getComponent('parallel', parallelIndex) === this;\n };\n\n ParallelModel.prototype.setAxisExpand = function (opt) {\n zrUtil.each(['axisExpandable', 'axisExpandCenter', 'axisExpandCount', 'axisExpandWidth', 'axisExpandWindow'], function (name) {\n if (opt.hasOwnProperty(name)) {\n // @ts-ignore FIXME: why \"never\" inferred in this.option[name]?\n this.option[name] = opt[name];\n }\n }, this);\n };\n\n ParallelModel.prototype._initDimensions = function () {\n var dimensions = this.dimensions = [];\n var parallelAxisIndex = this.parallelAxisIndex = [];\n var axisModels = zrUtil.filter(this.ecModel.queryComponents({\n mainType: 'parallelAxis'\n }), function (axisModel) {\n // Can not use this.contains here, because\n // initialization has not been completed yet.\n return (axisModel.get('parallelIndex') || 0) === this.componentIndex;\n }, this);\n zrUtil.each(axisModels, function (axisModel) {\n dimensions.push('dim' + axisModel.get('dim'));\n parallelAxisIndex.push(axisModel.componentIndex);\n });\n };\n\n ParallelModel.type = 'parallel';\n ParallelModel.dependencies = ['parallelAxis'];\n ParallelModel.layoutMode = 'box';\n ParallelModel.defaultOption = {\n zlevel: 0,\n z: 0,\n left: 80,\n top: 60,\n right: 80,\n bottom: 60,\n // width: {totalWidth} - left - right,\n // height: {totalHeight} - top - bottom,\n layout: 'horizontal',\n // FIXME\n // naming?\n axisExpandable: false,\n axisExpandCenter: null,\n axisExpandCount: 0,\n axisExpandWidth: 50,\n axisExpandRate: 17,\n axisExpandDebounce: 50,\n // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.\n // Do not doc to user until necessary.\n axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],\n axisExpandTriggerOn: 'click',\n parallelAxisDefault: null\n };\n return ParallelModel;\n}(ComponentModel);\n\nexport default ParallelModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as modelUtil from '../../util/model';\nexport default function parallelPreprocessor(option) {\n createParallelIfNeeded(option);\n mergeAxisOptionFromParallel(option);\n}\n/**\n * Create a parallel coordinate if not exists.\n * @inner\n */\n\nfunction createParallelIfNeeded(option) {\n if (option.parallel) {\n return;\n }\n\n var hasParallelSeries = false;\n zrUtil.each(option.series, function (seriesOpt) {\n if (seriesOpt && seriesOpt.type === 'parallel') {\n hasParallelSeries = true;\n }\n });\n\n if (hasParallelSeries) {\n option.parallel = [{}];\n }\n}\n/**\n * Merge aixs definition from parallel option (if exists) to axis option.\n * @inner\n */\n\n\nfunction mergeAxisOptionFromParallel(option) {\n var axes = modelUtil.normalizeToArray(option.parallelAxis);\n zrUtil.each(axes, function (axisOption) {\n if (!zrUtil.isObject(axisOption)) {\n return;\n }\n\n var parallelIndex = axisOption.parallelIndex || 0;\n var parallelOption = modelUtil.normalizeToArray(option.parallel)[parallelIndex];\n\n if (parallelOption && parallelOption.parallelAxisDefault) {\n zrUtil.merge(axisOption, parallelOption.parallelAxisDefault, false);\n }\n });\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n dataItem = dataItem || [0, 0];\n return zrUtil.map(['x', 'y'], function (dim, dimIdx) {\n var axis = this.getAxis(dim);\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n }, this);\n}\n\nexport default function cartesianPrepareCustom(coordSys) {\n var rect = coordSys.master.getRect();\n return {\n coordSys: {\n // The name exposed to user is always 'cartesian2d' but not 'grid'.\n type: 'cartesian2d',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: function (data) {\n // do not provide \"out\" param\n return coordSys.dataToPoint(data);\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n dataItem = dataItem || [0, 0];\n return zrUtil.map([0, 1], function (dimIdx) {\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var p1 = [];\n var p2 = [];\n p1[dimIdx] = val - halfSize;\n p2[dimIdx] = val + halfSize;\n p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];\n return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);\n }, this);\n}\n\nexport default function geoPrepareCustom(coordSys) {\n var rect = coordSys.getBoundingRect();\n return {\n coordSys: {\n type: 'geo',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n zoom: coordSys.getZoom()\n },\n api: {\n coord: function (data) {\n // do not provide \"out\" and noRoam param,\n // Compatible with this usage:\n // echarts.util.map(item.points, api.coord)\n return coordSys.dataToPoint(data);\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { bind } from 'zrender/lib/core/util';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n var axis = this.getAxis();\n var val = dataItem instanceof Array ? dataItem[0] : dataItem;\n var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;\n return axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n}\n\nexport default function singlePrepareCustom(coordSys) {\n var rect = coordSys.getRect();\n return {\n coordSys: {\n type: 'singleAxis',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n api: {\n coord: function (val) {\n // do not provide \"out\" param\n return coordSys.dataToPoint(val);\n },\n size: bind(dataToCoordSize, coordSys)\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util'; // import AngleAxis from './AngleAxis';\n\nfunction dataToCoordSize(dataSize, dataItem) {\n // dataItem is necessary in log axis.\n dataItem = dataItem || [0, 0];\n return zrUtil.map(['Radius', 'Angle'], function (dim, dimIdx) {\n var getterName = 'get' + dim + 'Axis'; // TODO: TYPE Check Angle Axis\n\n var axis = this[getterName]();\n var val = dataItem[dimIdx];\n var halfSize = dataSize[dimIdx] / 2;\n var result = axis.type === 'category' ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));\n\n if (dim === 'Angle') {\n result = result * Math.PI / 180;\n }\n\n return result;\n }, this);\n}\n\nexport default function polarPrepareCustom(coordSys) {\n var radiusAxis = coordSys.getRadiusAxis();\n var angleAxis = coordSys.getAngleAxis();\n var radius = radiusAxis.getExtent();\n radius[0] > radius[1] && radius.reverse();\n return {\n coordSys: {\n type: 'polar',\n cx: coordSys.cx,\n cy: coordSys.cy,\n r: radius[1],\n r0: radius[0]\n },\n api: {\n coord: function (data) {\n var radius = radiusAxis.dataToRadius(data[0]);\n var angle = angleAxis.dataToAngle(data[1]);\n var coord = coordSys.coordToPoint([radius, angle]);\n coord.push(radius, angle * Math.PI / 180);\n return coord;\n },\n size: zrUtil.bind(dataToCoordSize, coordSys)\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nexport default function calendarPrepareCustom(coordSys) {\n var rect = coordSys.getRect();\n var rangeInfo = coordSys.getRangeInfo();\n return {\n coordSys: {\n type: 'calendar',\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n cellWidth: coordSys.getCellWidth(),\n cellHeight: coordSys.getCellHeight(),\n rangeInfo: {\n start: rangeInfo.start,\n end: rangeInfo.end,\n weeks: rangeInfo.weeks,\n dayCount: rangeInfo.allDay\n }\n },\n api: {\n coord: function (data, clamp) {\n return coordSys.dataToPoint(data, clamp);\n }\n }\n };\n}","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport ComponentModel from '../../model/Component';\n\nvar PolarModel =\n/** @class */\nfunction (_super) {\n __extends(PolarModel, _super);\n\n function PolarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = PolarModel.type;\n return _this;\n }\n\n PolarModel.prototype.findAxisModel = function (axisType) {\n var foundAxisModel;\n var ecModel = this.ecModel;\n ecModel.eachComponent(axisType, function (axisModel) {\n if (axisModel.getCoordSysModel() === this) {\n foundAxisModel = axisModel;\n }\n }, this);\n return foundAxisModel;\n };\n\n PolarModel.type = 'polar';\n PolarModel.dependencies = ['radiusAxis', 'angleAxis'];\n PolarModel.defaultOption = {\n zlevel: 0,\n z: 0,\n center: ['50%', '50%'],\n radius: '80%'\n };\n return PolarModel;\n}(ComponentModel);\n\nexport default PolarModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as zrUtil from 'zrender/lib/core/util';\nimport ComponentModel from '../../model/Component';\nimport { getLayoutParams, sizeCalculable, mergeLayoutParam } from '../../util/layout';\n\nvar CalendarModel =\n/** @class */\nfunction (_super) {\n __extends(CalendarModel, _super);\n\n function CalendarModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = CalendarModel.type;\n return _this;\n }\n /**\n * @override\n */\n\n\n CalendarModel.prototype.init = function (option, parentModel, ecModel) {\n var inputPositionParams = getLayoutParams(option);\n\n _super.prototype.init.apply(this, arguments);\n\n mergeAndNormalizeLayoutParams(option, inputPositionParams);\n };\n /**\n * @override\n */\n\n\n CalendarModel.prototype.mergeOption = function (option) {\n _super.prototype.mergeOption.apply(this, arguments);\n\n mergeAndNormalizeLayoutParams(this.option, option);\n };\n\n CalendarModel.prototype.getCellSize = function () {\n // Has been normalized\n return this.option.cellSize;\n };\n\n CalendarModel.type = 'calendar';\n CalendarModel.defaultOption = {\n zlevel: 0,\n z: 2,\n left: 80,\n top: 60,\n cellSize: 20,\n // horizontal vertical\n orient: 'horizontal',\n // month separate line style\n splitLine: {\n show: true,\n lineStyle: {\n color: '#000',\n width: 1,\n type: 'solid'\n }\n },\n // rect style temporarily unused emphasis\n itemStyle: {\n color: '#fff',\n borderWidth: 1,\n borderColor: '#ccc'\n },\n // week text style\n dayLabel: {\n show: true,\n firstDay: 0,\n // start end\n position: 'start',\n margin: '50%',\n nameMap: 'en',\n color: '#000'\n },\n // month text style\n monthLabel: {\n show: true,\n // start end\n position: 'start',\n margin: 5,\n // center or left\n align: 'center',\n // cn en []\n nameMap: 'en',\n formatter: null,\n color: '#000'\n },\n // year text style\n yearLabel: {\n show: true,\n // top bottom left right\n position: null,\n margin: 30,\n formatter: null,\n color: '#ccc',\n fontFamily: 'sans-serif',\n fontWeight: 'bolder',\n fontSize: 20\n }\n };\n return CalendarModel;\n}(ComponentModel);\n\nfunction mergeAndNormalizeLayoutParams(target, raw) {\n // Normalize cellSize\n var cellSize = target.cellSize;\n var cellSizeArr;\n\n if (!zrUtil.isArray(cellSize)) {\n cellSizeArr = target.cellSize = [cellSize, cellSize];\n } else {\n cellSizeArr = cellSize;\n }\n\n if (cellSizeArr.length === 1) {\n cellSizeArr[1] = cellSizeArr[0];\n }\n\n var ignoreSize = zrUtil.map([0, 1], function (hvIdx) {\n // If user have set `width` or both `left` and `right`, cellSizeArr\n // will be automatically set to 'auto', otherwise the default\n // setting of cellSizeArr will make `width` setting not work.\n if (sizeCalculable(raw, hvIdx)) {\n cellSizeArr[hvIdx] = 'auto';\n }\n\n return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== 'auto';\n });\n mergeLayoutParam(target, raw, {\n type: 'box',\n ignoreSize: ignoreSize\n });\n}\n\nexport default CalendarModel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as layout from '../../util/layout';\nimport * as numberUtil from '../../util/number'; // (24*60*60*1000)\n\nvar PROXIMATE_ONE_DAY = 86400000;\n\nvar Calendar =\n/** @class */\nfunction () {\n function Calendar(calendarModel, ecModel, api) {\n this.type = 'calendar';\n this.dimensions = Calendar.dimensions; // Required in createListFromData\n\n this.getDimensionsInfo = Calendar.getDimensionsInfo;\n this._model = calendarModel;\n }\n\n Calendar.getDimensionsInfo = function () {\n return [{\n name: 'time',\n type: 'time'\n }, 'value'];\n };\n\n Calendar.prototype.getRangeInfo = function () {\n return this._rangeInfo;\n };\n\n Calendar.prototype.getModel = function () {\n return this._model;\n };\n\n Calendar.prototype.getRect = function () {\n return this._rect;\n };\n\n Calendar.prototype.getCellWidth = function () {\n return this._sw;\n };\n\n Calendar.prototype.getCellHeight = function () {\n return this._sh;\n };\n\n Calendar.prototype.getOrient = function () {\n return this._orient;\n };\n /**\n * getFirstDayOfWeek\n *\n * @example\n * 0 : start at Sunday\n * 1 : start at Monday\n *\n * @return {number}\n */\n\n\n Calendar.prototype.getFirstDayOfWeek = function () {\n return this._firstDayOfWeek;\n };\n /**\n * get date info\n * }\n */\n\n\n Calendar.prototype.getDateInfo = function (date) {\n date = numberUtil.parseDate(date);\n var y = date.getFullYear();\n var m = date.getMonth() + 1;\n var mStr = m < 10 ? '0' + m : '' + m;\n var d = date.getDate();\n var dStr = d < 10 ? '0' + d : '' + d;\n var day = date.getDay();\n day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);\n return {\n y: y + '',\n m: mStr,\n d: dStr,\n day: day,\n time: date.getTime(),\n formatedDate: y + '-' + mStr + '-' + dStr,\n date: date\n };\n };\n\n Calendar.prototype.getNextNDay = function (date, n) {\n n = n || 0;\n\n if (n === 0) {\n return this.getDateInfo(date);\n }\n\n date = new Date(this.getDateInfo(date).time);\n date.setDate(date.getDate() + n);\n return this.getDateInfo(date);\n };\n\n Calendar.prototype.update = function (ecModel, api) {\n this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay');\n this._orient = this._model.get('orient');\n this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0;\n this._rangeInfo = this._getRangeInfo(this._initRangeOption());\n var weeks = this._rangeInfo.weeks || 1;\n var whNames = ['width', 'height'];\n\n var cellSize = this._model.getCellSize().slice();\n\n var layoutParams = this._model.getBoxLayoutParams();\n\n var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks];\n zrUtil.each([0, 1], function (idx) {\n if (cellSizeSpecified(cellSize, idx)) {\n layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];\n }\n });\n var whGlobal = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var calendarRect = this._rect = layout.getLayoutRect(layoutParams, whGlobal);\n zrUtil.each([0, 1], function (idx) {\n if (!cellSizeSpecified(cellSize, idx)) {\n cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];\n }\n });\n\n function cellSizeSpecified(cellSize, idx) {\n return cellSize[idx] != null && cellSize[idx] !== 'auto';\n } // Has been calculated out number.\n\n\n this._sw = cellSize[0];\n this._sh = cellSize[1];\n };\n /**\n * Convert a time data(time, value) item to (x, y) point.\n */\n // TODO Clamp of calendar is not same with cartesian coordinate systems.\n // It will return NaN if data exceeds.\n\n\n Calendar.prototype.dataToPoint = function (data, clamp) {\n zrUtil.isArray(data) && (data = data[0]);\n clamp == null && (clamp = true);\n var dayInfo = this.getDateInfo(data);\n var range = this._rangeInfo;\n var date = dayInfo.formatedDate; // if not in range return [NaN, NaN]\n\n if (clamp && !(dayInfo.time >= range.start.time && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY)) {\n return [NaN, NaN];\n }\n\n var week = dayInfo.day;\n\n var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek;\n\n if (this._orient === 'vertical') {\n return [this._rect.x + week * this._sw + this._sw / 2, this._rect.y + nthWeek * this._sh + this._sh / 2];\n }\n\n return [this._rect.x + nthWeek * this._sw + this._sw / 2, this._rect.y + week * this._sh + this._sh / 2];\n };\n /**\n * Convert a (x, y) point to time data\n */\n\n\n Calendar.prototype.pointToData = function (point) {\n var date = this.pointToDate(point);\n return date && date.time;\n };\n /**\n * Convert a time date item to (x, y) four point.\n */\n\n\n Calendar.prototype.dataToRect = function (data, clamp) {\n var point = this.dataToPoint(data, clamp);\n return {\n contentShape: {\n x: point[0] - (this._sw - this._lineWidth) / 2,\n y: point[1] - (this._sh - this._lineWidth) / 2,\n width: this._sw - this._lineWidth,\n height: this._sh - this._lineWidth\n },\n center: point,\n tl: [point[0] - this._sw / 2, point[1] - this._sh / 2],\n tr: [point[0] + this._sw / 2, point[1] - this._sh / 2],\n br: [point[0] + this._sw / 2, point[1] + this._sh / 2],\n bl: [point[0] - this._sw / 2, point[1] + this._sh / 2]\n };\n };\n /**\n * Convert a (x, y) point to time date\n *\n * @param {Array} point point\n * @return {Object} date\n */\n\n\n Calendar.prototype.pointToDate = function (point) {\n var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;\n var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;\n var range = this._rangeInfo.range;\n\n if (this._orient === 'vertical') {\n return this._getDateByWeeksAndDay(nthY, nthX - 1, range);\n }\n\n return this._getDateByWeeksAndDay(nthX, nthY - 1, range);\n };\n\n Calendar.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.dataToPoint(value) : null;\n };\n\n Calendar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? coordSys.pointToData(pixel) : null;\n };\n\n Calendar.prototype.containPoint = function (point) {\n console.warn('Not implemented.');\n return false;\n };\n /**\n * initRange\n * Normalize to an [start, end] array\n */\n\n\n Calendar.prototype._initRangeOption = function () {\n var range = this._model.get('range');\n\n var normalizedRange; // Convert [1990] to 1990\n\n if (zrUtil.isArray(range) && range.length === 1) {\n range = range[0];\n }\n\n if (!zrUtil.isArray(range)) {\n var rangeStr = range.toString(); // One year.\n\n if (/^\\d{4}$/.test(rangeStr)) {\n normalizedRange = [rangeStr + '-01-01', rangeStr + '-12-31'];\n } // One month\n\n\n if (/^\\d{4}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\n var start = this.getDateInfo(rangeStr);\n var firstDay = start.date;\n firstDay.setMonth(firstDay.getMonth() + 1);\n var end = this.getNextNDay(firstDay, -1);\n normalizedRange = [start.formatedDate, end.formatedDate];\n } // One day\n\n\n if (/^\\d{4}[\\/|-]\\d{1,2}[\\/|-]\\d{1,2}$/.test(rangeStr)) {\n normalizedRange = [rangeStr, rangeStr];\n }\n } else {\n normalizedRange = range;\n }\n\n if (!normalizedRange) {\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.logError('Invalid date range.');\n } // Not handling it.\n\n\n return range;\n }\n\n var tmp = this._getRangeInfo(normalizedRange);\n\n if (tmp.start.time > tmp.end.time) {\n normalizedRange.reverse();\n }\n\n return normalizedRange;\n };\n /**\n * range info\n *\n * @private\n * @param {Array} range range ['2017-01-01', '2017-07-08']\n * If range[0] > range[1], they will not be reversed.\n * @return {Object} obj\n */\n\n\n Calendar.prototype._getRangeInfo = function (range) {\n var parsedRange = [this.getDateInfo(range[0]), this.getDateInfo(range[1])];\n var reversed;\n\n if (parsedRange[0].time > parsedRange[1].time) {\n reversed = true;\n parsedRange.reverse();\n }\n\n var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1; // Consider case1 (#11677 #10430):\n // Set the system timezone as \"UK\", set the range to `['2016-07-01', '2016-12-31']`\n // Consider case2:\n // Firstly set system timezone as \"Time Zone: America/Toronto\",\n // ```\n // let first = new Date(1478412000000 - 3600 * 1000 * 2.5);\n // let second = new Date(1478412000000);\n // let allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1;\n // ```\n // will get wrong result because of DST. So we should fix it.\n\n var date = new Date(parsedRange[0].time);\n var startDateNum = date.getDate();\n var endDateNum = parsedRange[1].date.getDate();\n date.setDate(startDateNum + allDay - 1); // The bias can not over a month, so just compare date.\n\n var dateNum = date.getDate();\n\n if (dateNum !== endDateNum) {\n var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;\n\n while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) {\n allDay -= sign;\n date.setDate(dateNum - sign);\n }\n }\n\n var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);\n var nthWeek = reversed ? -weeks + 1 : weeks - 1;\n reversed && parsedRange.reverse();\n return {\n range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],\n start: parsedRange[0],\n end: parsedRange[1],\n allDay: allDay,\n weeks: weeks,\n // From 0.\n nthWeek: nthWeek,\n fweek: parsedRange[0].day,\n lweek: parsedRange[1].day\n };\n };\n /**\n * get date by nthWeeks and week day in range\n *\n * @private\n * @param {number} nthWeek the week\n * @param {number} day the week day\n * @param {Array} range [d1, d2]\n * @return {Object}\n */\n\n\n Calendar.prototype._getDateByWeeksAndDay = function (nthWeek, day, range) {\n var rangeInfo = this._getRangeInfo(range);\n\n if (nthWeek > rangeInfo.weeks || nthWeek === 0 && day < rangeInfo.fweek || nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) {\n return null;\n }\n\n var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;\n var date = new Date(rangeInfo.start.time);\n date.setDate(+rangeInfo.start.d + nthDay);\n return this.getDateInfo(date);\n };\n\n Calendar.create = function (ecModel, api) {\n var calendarList = [];\n ecModel.eachComponent('calendar', function (calendarModel) {\n var calendar = new Calendar(calendarModel, ecModel, api);\n calendarList.push(calendar);\n calendarModel.coordinateSystem = calendar;\n });\n ecModel.eachSeries(function (calendarSeries) {\n if (calendarSeries.get('coordinateSystem') === 'calendar') {\n // Inject coordinate system\n calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0];\n }\n });\n return calendarList;\n };\n\n Calendar.dimensions = ['time', 'value'];\n return Calendar;\n}();\n\nfunction getCoordSys(finder) {\n var calendarModel = finder.calendarModel;\n var seriesModel = finder.seriesModel;\n var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null;\n return coordSys;\n}\n\nexport default Calendar;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\n\nvar Cartesian =\n/** @class */\nfunction () {\n function Cartesian(name) {\n this.type = 'cartesian';\n this._dimList = [];\n this._axes = {};\n this.name = name || '';\n }\n\n Cartesian.prototype.getAxis = function (dim) {\n return this._axes[dim];\n };\n\n Cartesian.prototype.getAxes = function () {\n return zrUtil.map(this._dimList, function (dim) {\n return this._axes[dim];\n }, this);\n };\n\n Cartesian.prototype.getAxesByScale = function (scaleType) {\n scaleType = scaleType.toLowerCase();\n return zrUtil.filter(this.getAxes(), function (axis) {\n return axis.scale.type === scaleType;\n });\n };\n\n Cartesian.prototype.addAxis = function (axis) {\n var dim = axis.dim;\n this._axes[dim] = axis;\n\n this._dimList.push(dim);\n };\n\n return Cartesian;\n}();\n\n;\nexport default Cartesian;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport BoundingRect from 'zrender/lib/core/BoundingRect';\nimport Cartesian from './Cartesian';\nimport { invert } from 'zrender/lib/core/matrix';\nimport { applyTransform } from 'zrender/lib/core/vector';\nexport var cartesian2DDimensions = ['x', 'y'];\n\nfunction canCalculateAffineTransform(scale) {\n return scale.type === 'interval' || scale.type === 'time';\n}\n\nvar Cartesian2D =\n/** @class */\nfunction (_super) {\n __extends(Cartesian2D, _super);\n\n function Cartesian2D() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.type = 'cartesian2d';\n _this.dimensions = cartesian2DDimensions;\n return _this;\n }\n /**\n * Calculate an affine transform matrix if two axes are time or value.\n * It's mainly for accelartion on the large time series data.\n */\n\n\n Cartesian2D.prototype.calcAffineTransform = function () {\n this._transform = this._invTransform = null;\n var xAxisScale = this.getAxis('x').scale;\n var yAxisScale = this.getAxis('y').scale;\n\n if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {\n return;\n }\n\n var xScaleExtent = xAxisScale.getExtent();\n var yScaleExtent = yAxisScale.getExtent();\n var start = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);\n var end = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);\n var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];\n var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];\n\n if (!xScaleSpan || !yScaleSpan) {\n return;\n } // Accelerate data to point calculation on the special large time series data.\n\n\n var scaleX = (end[0] - start[0]) / xScaleSpan;\n var scaleY = (end[1] - start[1]) / yScaleSpan;\n var translateX = start[0] - xScaleExtent[0] * scaleX;\n var translateY = start[1] - yScaleExtent[0] * scaleY;\n var m = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];\n this._invTransform = invert([], m);\n };\n /**\n * Base axis will be used on stacking.\n */\n\n\n Cartesian2D.prototype.getBaseAxis = function () {\n return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAxis('x');\n };\n\n Cartesian2D.prototype.containPoint = function (point) {\n var axisX = this.getAxis('x');\n var axisY = this.getAxis('y');\n return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1]));\n };\n\n Cartesian2D.prototype.containData = function (data) {\n return this.getAxis('x').containData(data[0]) && this.getAxis('y').containData(data[1]);\n };\n\n Cartesian2D.prototype.dataToPoint = function (data, clamp, out) {\n out = out || [];\n var xVal = data[0];\n var yVal = data[1]; // Fast path\n\n if (this._transform // It's supported that if data is like `[Inifity, 123]`, where only Y pixel calculated.\n && xVal != null && isFinite(xVal) && yVal != null && isFinite(yVal)) {\n return applyTransform(out, data, this._transform);\n }\n\n var xAxis = this.getAxis('x');\n var yAxis = this.getAxis('y');\n out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp));\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp));\n return out;\n };\n\n Cartesian2D.prototype.clampData = function (data, out) {\n var xScale = this.getAxis('x').scale;\n var yScale = this.getAxis('y').scale;\n var xAxisExtent = xScale.getExtent();\n var yAxisExtent = yScale.getExtent();\n var x = xScale.parse(data[0]);\n var y = yScale.parse(data[1]);\n out = out || [];\n out[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), Math.max(xAxisExtent[0], xAxisExtent[1]));\n out[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));\n return out;\n };\n\n Cartesian2D.prototype.pointToData = function (point, clamp) {\n var out = [];\n\n if (this._invTransform) {\n return applyTransform(out, point, this._invTransform);\n }\n\n var xAxis = this.getAxis('x');\n var yAxis = this.getAxis('y');\n out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp);\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp);\n return out;\n };\n\n Cartesian2D.prototype.getOtherAxis = function (axis) {\n return this.getAxis(axis.dim === 'x' ? 'y' : 'x');\n };\n /**\n * Get rect area of cartesian.\n * Area will have a contain function to determine if a point is in the coordinate system.\n */\n\n\n Cartesian2D.prototype.getArea = function () {\n var xExtent = this.getAxis('x').getGlobalExtent();\n var yExtent = this.getAxis('y').getGlobalExtent();\n var x = Math.min(xExtent[0], xExtent[1]);\n var y = Math.min(yExtent[0], yExtent[1]);\n var width = Math.max(xExtent[0], xExtent[1]) - x;\n var height = Math.max(yExtent[0], yExtent[1]) - y;\n return new BoundingRect(x, y, width, height);\n };\n\n return Cartesian2D;\n}(Cartesian);\n\n;\nexport default Cartesian2D;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis';\n\nvar Axis2D =\n/** @class */\nfunction (_super) {\n __extends(Axis2D, _super);\n\n function Axis2D(dim, scale, coordExtent, axisType, position) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n /**\n * Index of axis, can be used as key\n * Injected outside.\n */\n\n\n _this.index = 0;\n _this.type = axisType || 'value';\n _this.position = position || 'bottom';\n return _this;\n }\n\n Axis2D.prototype.isHorizontal = function () {\n var position = this.position;\n return position === 'top' || position === 'bottom';\n };\n /**\n * Each item cooresponds to this.getExtent(), which\n * means globalExtent[0] may greater than globalExtent[1],\n * unless `asc` is input.\n *\n * @param {boolean} [asc]\n * @return {Array.}\n */\n\n\n Axis2D.prototype.getGlobalExtent = function (asc) {\n var ret = this.getExtent();\n ret[0] = this.toGlobalCoord(ret[0]);\n ret[1] = this.toGlobalCoord(ret[1]);\n asc && ret[0] > ret[1] && ret.reverse();\n return ret;\n };\n\n Axis2D.prototype.pointToData = function (point, clamp) {\n return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp);\n };\n /**\n * Set ordinalSortInfo\n * @param info new OrdinalSortInfo\n */\n\n\n Axis2D.prototype.setCategorySortInfo = function (info) {\n if (this.type !== 'category') {\n return false;\n }\n\n this.model.option.categorySortInfo = info;\n this.scale.setSortInfo(info);\n };\n\n return Axis2D;\n}(Axis);\n\nexport default Axis2D;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Grid is a region which contains at most 4 cartesian systems\n *\n * TODO Default cartesian\n */\nimport { isObject, each, indexOf, retrieve3 } from 'zrender/lib/core/util';\nimport { getLayoutRect } from '../../util/layout';\nimport { createScaleByModel, ifAxisCrossZero, niceScaleExtent, estimateLabelUnionRect, getDataDimensionsOnAxis } from '../../coord/axisHelper';\nimport Cartesian2D, { cartesian2DDimensions } from './Cartesian2D';\nimport Axis2D from './Axis2D';\nimport { SINGLE_REFERRING } from '../../util/model';\nimport { isCartesian2DSeries, findAxisModels } from './cartesianAxisHelper';\n\nvar Grid =\n/** @class */\nfunction () {\n function Grid(gridModel, ecModel, api) {\n // FIXME:TS where used (different from registered type 'cartesian2d')?\n this.type = 'grid';\n this._coordsMap = {};\n this._coordsList = [];\n this._axesMap = {};\n this._axesList = [];\n this.axisPointerEnabled = true;\n this.dimensions = cartesian2DDimensions;\n\n this._initCartesian(gridModel, ecModel, api);\n\n this.model = gridModel;\n }\n\n Grid.prototype.getRect = function () {\n return this._rect;\n };\n\n Grid.prototype.update = function (ecModel, api) {\n var axesMap = this._axesMap;\n\n this._updateScale(ecModel, this.model);\n\n each(axesMap.x, function (xAxis) {\n niceScaleExtent(xAxis.scale, xAxis.model);\n });\n each(axesMap.y, function (yAxis) {\n niceScaleExtent(yAxis.scale, yAxis.model);\n }); // Key: axisDim_axisIndex, value: boolean, whether onZero target.\n\n var onZeroRecords = {};\n each(axesMap.x, function (xAxis) {\n fixAxisOnZero(axesMap, 'y', xAxis, onZeroRecords);\n });\n each(axesMap.y, function (yAxis) {\n fixAxisOnZero(axesMap, 'x', yAxis, onZeroRecords);\n }); // Resize again if containLabel is enabled\n // FIXME It may cause getting wrong grid size in data processing stage\n\n this.resize(this.model, api);\n };\n /**\n * Resize the grid\n */\n\n\n Grid.prototype.resize = function (gridModel, api, ignoreContainLabel) {\n var boxLayoutParams = gridModel.getBoxLayoutParams();\n var isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');\n var gridRect = getLayoutRect(boxLayoutParams, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n this._rect = gridRect;\n var axesList = this._axesList;\n adjustAxes(); // Minus label size\n\n if (isContainLabel) {\n each(axesList, function (axis) {\n if (!axis.model.get(['axisLabel', 'inside'])) {\n var labelUnionRect = estimateLabelUnionRect(axis);\n\n if (labelUnionRect) {\n var dim = axis.isHorizontal() ? 'height' : 'width';\n var margin = axis.model.get(['axisLabel', 'margin']);\n gridRect[dim] -= labelUnionRect[dim] + margin;\n\n if (axis.position === 'top') {\n gridRect.y += labelUnionRect.height + margin;\n } else if (axis.position === 'left') {\n gridRect.x += labelUnionRect.width + margin;\n }\n }\n }\n });\n adjustAxes();\n }\n\n each(this._coordsList, function (coord) {\n // Calculate affine matrix to accelerate the data to point transform.\n // If all the axes scales are time or value.\n coord.calcAffineTransform();\n });\n\n function adjustAxes() {\n each(axesList, function (axis) {\n var isHorizontal = axis.isHorizontal();\n var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(extent[idx], extent[1 - idx]);\n updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y);\n });\n }\n };\n\n Grid.prototype.getAxis = function (dim, axisIndex) {\n var axesMapOnDim = this._axesMap[dim];\n\n if (axesMapOnDim != null) {\n return axesMapOnDim[axisIndex || 0]; // if (axisIndex == null) {\n // Find first axis\n // for (let name in axesMapOnDim) {\n // if (axesMapOnDim.hasOwnProperty(name)) {\n // return axesMapOnDim[name];\n // }\n // }\n // }\n // return axesMapOnDim[axisIndex];\n }\n };\n\n Grid.prototype.getAxes = function () {\n return this._axesList.slice();\n };\n\n Grid.prototype.getCartesian = function (xAxisIndex, yAxisIndex) {\n if (xAxisIndex != null && yAxisIndex != null) {\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\n return this._coordsMap[key];\n }\n\n if (isObject(xAxisIndex)) {\n yAxisIndex = xAxisIndex.yAxisIndex;\n xAxisIndex = xAxisIndex.xAxisIndex;\n }\n\n for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) {\n if (coordList[i].getAxis('x').index === xAxisIndex || coordList[i].getAxis('y').index === yAxisIndex) {\n return coordList[i];\n }\n }\n };\n\n Grid.prototype.getCartesians = function () {\n return this._coordsList.slice();\n };\n /**\n * @implements\n */\n\n\n Grid.prototype.convertToPixel = function (ecModel, finder, value) {\n var target = this._findConvertTarget(finder);\n\n return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null;\n };\n /**\n * @implements\n */\n\n\n Grid.prototype.convertFromPixel = function (ecModel, finder, value) {\n var target = this._findConvertTarget(finder);\n\n return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null;\n };\n\n Grid.prototype._findConvertTarget = function (finder) {\n var seriesModel = finder.seriesModel;\n var xAxisModel = finder.xAxisModel || seriesModel && seriesModel.getReferringComponents('xAxis', SINGLE_REFERRING).models[0];\n var yAxisModel = finder.yAxisModel || seriesModel && seriesModel.getReferringComponents('yAxis', SINGLE_REFERRING).models[0];\n var gridModel = finder.gridModel;\n var coordsList = this._coordsList;\n var cartesian;\n var axis;\n\n if (seriesModel) {\n cartesian = seriesModel.coordinateSystem;\n indexOf(coordsList, cartesian) < 0 && (cartesian = null);\n } else if (xAxisModel && yAxisModel) {\n cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n } else if (xAxisModel) {\n axis = this.getAxis('x', xAxisModel.componentIndex);\n } else if (yAxisModel) {\n axis = this.getAxis('y', yAxisModel.componentIndex);\n } // Lowest priority.\n else if (gridModel) {\n var grid = gridModel.coordinateSystem;\n\n if (grid === this) {\n cartesian = this._coordsList[0];\n }\n }\n\n return {\n cartesian: cartesian,\n axis: axis\n };\n };\n /**\n * @implements\n */\n\n\n Grid.prototype.containPoint = function (point) {\n var coord = this._coordsList[0];\n\n if (coord) {\n return coord.containPoint(point);\n }\n };\n /**\n * Initialize cartesian coordinate systems\n */\n\n\n Grid.prototype._initCartesian = function (gridModel, ecModel, api) {\n var _this = this;\n\n var grid = this;\n var axisPositionUsed = {\n left: false,\n right: false,\n top: false,\n bottom: false\n };\n var axesMap = {\n x: {},\n y: {}\n };\n var axesCount = {\n x: 0,\n y: 0\n }; /// Create axis\n\n ecModel.eachComponent('xAxis', createAxisCreator('x'), this);\n ecModel.eachComponent('yAxis', createAxisCreator('y'), this);\n\n if (!axesCount.x || !axesCount.y) {\n // Roll back when there no either x or y axis\n this._axesMap = {};\n this._axesList = [];\n return;\n }\n\n this._axesMap = axesMap; /// Create cartesian2d\n\n each(axesMap.x, function (xAxis, xAxisIndex) {\n each(axesMap.y, function (yAxis, yAxisIndex) {\n var key = 'x' + xAxisIndex + 'y' + yAxisIndex;\n var cartesian = new Cartesian2D(key);\n cartesian.master = _this;\n cartesian.model = gridModel;\n _this._coordsMap[key] = cartesian;\n\n _this._coordsList.push(cartesian);\n\n cartesian.addAxis(xAxis);\n cartesian.addAxis(yAxis);\n });\n });\n\n function createAxisCreator(dimName) {\n return function (axisModel, idx) {\n if (!isAxisUsedInTheGrid(axisModel, gridModel)) {\n return;\n }\n\n var axisPosition = axisModel.get('position');\n\n if (dimName === 'x') {\n // Fix position\n if (axisPosition !== 'top' && axisPosition !== 'bottom') {\n // Default bottom of X\n axisPosition = axisPositionUsed.bottom ? 'top' : 'bottom';\n }\n } else {\n // Fix position\n if (axisPosition !== 'left' && axisPosition !== 'right') {\n // Default left of Y\n axisPosition = axisPositionUsed.left ? 'right' : 'left';\n }\n }\n\n axisPositionUsed[axisPosition] = true;\n var axis = new Axis2D(dimName, createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisPosition);\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse'); // Inject axis into axisModel\n\n axisModel.axis = axis; // Inject axisModel into axis\n\n axis.model = axisModel; // Inject grid info axis\n\n axis.grid = grid; // Index of axis, can be used as key\n\n axis.index = idx;\n\n grid._axesList.push(axis);\n\n axesMap[dimName][idx] = axis;\n axesCount[dimName]++;\n };\n }\n };\n /**\n * Update cartesian properties from series.\n */\n\n\n Grid.prototype._updateScale = function (ecModel, gridModel) {\n // Reset scale\n each(this._axesList, function (axis) {\n axis.scale.setExtent(Infinity, -Infinity);\n\n if (axis.type === 'category') {\n var categorySortInfo = axis.model.get('categorySortInfo');\n axis.scale.setSortInfo(categorySortInfo);\n }\n });\n ecModel.eachSeries(function (seriesModel) {\n if (isCartesian2DSeries(seriesModel)) {\n var axesModelMap = findAxisModels(seriesModel);\n var xAxisModel = axesModelMap.xAxisModel;\n var yAxisModel = axesModelMap.yAxisModel;\n\n if (!isAxisUsedInTheGrid(xAxisModel, gridModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {\n return;\n }\n\n var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n var data = seriesModel.getData();\n var xAxis = cartesian.getAxis('x');\n var yAxis = cartesian.getAxis('y');\n\n if (data.type === 'list') {\n unionExtent(data, xAxis);\n unionExtent(data, yAxis);\n }\n }\n }, this);\n\n function unionExtent(data, axis) {\n each(getDataDimensionsOnAxis(data, axis.dim), function (dim) {\n axis.scale.unionExtentFromData(data, dim);\n });\n }\n };\n /**\n * @param dim 'x' or 'y' or 'auto' or null/undefined\n */\n\n\n Grid.prototype.getTooltipAxes = function (dim) {\n var baseAxes = [];\n var otherAxes = [];\n each(this.getCartesians(), function (cartesian) {\n var baseAxis = dim != null && dim !== 'auto' ? cartesian.getAxis(dim) : cartesian.getBaseAxis();\n var otherAxis = cartesian.getOtherAxis(baseAxis);\n indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);\n indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);\n });\n return {\n baseAxes: baseAxes,\n otherAxes: otherAxes\n };\n };\n\n Grid.create = function (ecModel, api) {\n var grids = [];\n ecModel.eachComponent('grid', function (gridModel, idx) {\n var grid = new Grid(gridModel, ecModel, api);\n grid.name = 'grid_' + idx; // dataSampling requires axis extent, so resize\n // should be performed in create stage.\n\n grid.resize(gridModel, api, true);\n gridModel.coordinateSystem = grid;\n grids.push(grid);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (!isCartesian2DSeries(seriesModel)) {\n return;\n }\n\n var axesModelMap = findAxisModels(seriesModel);\n var xAxisModel = axesModelMap.xAxisModel;\n var yAxisModel = axesModelMap.yAxisModel;\n var gridModel = xAxisModel.getCoordSysModel();\n\n if (process.env.NODE_ENV !== 'production') {\n if (!gridModel) {\n throw new Error('Grid \"' + retrieve3(xAxisModel.get('gridIndex'), xAxisModel.get('gridId'), 0) + '\" not found');\n }\n\n if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) {\n throw new Error('xAxis and yAxis must use the same grid');\n }\n }\n\n var grid = gridModel.coordinateSystem;\n seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);\n });\n return grids;\n }; // For deciding which dimensions to use when creating list data\n\n\n Grid.dimensions = cartesian2DDimensions;\n return Grid;\n}();\n/**\n * Check if the axis is used in the specified grid.\n */\n\n\nfunction isAxisUsedInTheGrid(axisModel, gridModel) {\n return axisModel.getCoordSysModel() === gridModel;\n}\n\nfunction fixAxisOnZero(axesMap, otherAxisDim, axis, // Key: see `getOnZeroRecordKey`\nonZeroRecords) {\n axis.getAxesOnZeroOf = function () {\n // TODO: onZero of multiple axes.\n return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];\n }; // onZero can not be enabled in these two situations:\n // 1. When any other axis is a category axis.\n // 2. When no axis is cross 0 point.\n\n\n var otherAxes = axesMap[otherAxisDim];\n var otherAxisOnZeroOf;\n var axisModel = axis.model;\n var onZero = axisModel.get(['axisLine', 'onZero']);\n var onZeroAxisIndex = axisModel.get(['axisLine', 'onZeroAxisIndex']);\n\n if (!onZero) {\n return;\n } // If target axis is specified.\n\n\n if (onZeroAxisIndex != null) {\n if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {\n otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];\n }\n } else {\n // Find the first available other axis.\n for (var idx in otherAxes) {\n if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx]) // Consider that two Y axes on one value axis,\n // if both onZero, the two Y axes overlap.\n && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {\n otherAxisOnZeroOf = otherAxes[idx];\n break;\n }\n }\n }\n\n if (otherAxisOnZeroOf) {\n onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;\n }\n\n function getOnZeroRecordKey(axis) {\n return axis.dim + '_' + axis.index;\n }\n}\n\nfunction canOnZeroToAxis(axis) {\n return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis);\n}\n\nfunction updateAxisTransform(axis, coordBase) {\n var axisExtent = axis.getExtent();\n var axisExtentSum = axisExtent[0] + axisExtent[1]; // Fast transform\n\n axis.toGlobalCoord = axis.dim === 'x' ? function (coord) {\n return coord + coordBase;\n } : function (coord) {\n return axisExtentSum - coord + coordBase;\n };\n axis.toLocalCoord = axis.dim === 'x' ? function (coord) {\n return coord - coordBase;\n } : function (coord) {\n return axisExtentSum - coord + coordBase;\n };\n}\n\nexport default Grid;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis';\n\nvar RadiusAxis =\n/** @class */\nfunction (_super) {\n __extends(RadiusAxis, _super);\n\n function RadiusAxis(scale, radiusExtent) {\n return _super.call(this, 'radius', scale, radiusExtent) || this;\n }\n\n RadiusAxis.prototype.pointToData = function (point, clamp) {\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\n };\n\n return RadiusAxis;\n}(Axis);\n\nRadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord;\nRadiusAxis.prototype.radiusToData = Axis.prototype.coordToData;\nexport default RadiusAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport * as textContain from 'zrender/lib/contain/text';\nimport Axis from '../Axis';\nimport { makeInner } from '../../util/model';\nvar inner = makeInner();\n\nvar AngleAxis =\n/** @class */\nfunction (_super) {\n __extends(AngleAxis, _super);\n\n function AngleAxis(scale, angleExtent) {\n return _super.call(this, 'angle', scale, angleExtent || [0, 360]) || this;\n }\n\n AngleAxis.prototype.pointToData = function (point, clamp) {\n return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1];\n };\n /**\n * Only be called in category axis.\n * Angle axis uses text height to decide interval\n *\n * @override\n * @return {number} Auto interval for cateogry axis tick and label\n */\n\n\n AngleAxis.prototype.calculateCategoryInterval = function () {\n var axis = this;\n var labelModel = axis.getLabelModel();\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitH = Math.abs(unitSpan); // Not precise, just use height as text width\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(tickValue == null ? '' : tickValue + '', labelModel.getFont(), 'center', 'top');\n var maxH = Math.max(rect.height, 7);\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(dh));\n var cache = inner(axis.model);\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n }\n\n return interval;\n };\n\n return AngleAxis;\n}(Axis);\n\nAngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord;\nAngleAxis.prototype.angleToData = Axis.prototype.coordToData;\nexport default AngleAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport RadiusAxis from './RadiusAxis';\nimport AngleAxis from './AngleAxis';\nexport var polarDimensions = ['radius', 'angle'];\n\nvar Polar =\n/** @class */\nfunction () {\n function Polar(name) {\n this.dimensions = polarDimensions;\n this.type = 'polar';\n /**\n * x of polar center\n */\n\n this.cx = 0;\n /**\n * y of polar center\n */\n\n this.cy = 0;\n this._radiusAxis = new RadiusAxis();\n this._angleAxis = new AngleAxis();\n this.axisPointerEnabled = true;\n this.name = name || '';\n this._radiusAxis.polar = this._angleAxis.polar = this;\n }\n /**\n * If contain coord\n */\n\n\n Polar.prototype.containPoint = function (point) {\n var coord = this.pointToCoord(point);\n return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]);\n };\n /**\n * If contain data\n */\n\n\n Polar.prototype.containData = function (data) {\n return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]);\n };\n\n Polar.prototype.getAxis = function (dim) {\n var key = '_' + dim + 'Axis';\n return this[key];\n };\n\n Polar.prototype.getAxes = function () {\n return [this._radiusAxis, this._angleAxis];\n };\n /**\n * Get axes by type of scale\n */\n\n\n Polar.prototype.getAxesByScale = function (scaleType) {\n var axes = [];\n var angleAxis = this._angleAxis;\n var radiusAxis = this._radiusAxis;\n angleAxis.scale.type === scaleType && axes.push(angleAxis);\n radiusAxis.scale.type === scaleType && axes.push(radiusAxis);\n return axes;\n };\n\n Polar.prototype.getAngleAxis = function () {\n return this._angleAxis;\n };\n\n Polar.prototype.getRadiusAxis = function () {\n return this._radiusAxis;\n };\n\n Polar.prototype.getOtherAxis = function (axis) {\n var angleAxis = this._angleAxis;\n return axis === angleAxis ? this._radiusAxis : angleAxis;\n };\n /**\n * Base axis will be used on stacking.\n *\n */\n\n\n Polar.prototype.getBaseAxis = function () {\n return this.getAxesByScale('ordinal')[0] || this.getAxesByScale('time')[0] || this.getAngleAxis();\n };\n\n Polar.prototype.getTooltipAxes = function (dim) {\n var baseAxis = dim != null && dim !== 'auto' ? this.getAxis(dim) : this.getBaseAxis();\n return {\n baseAxes: [baseAxis],\n otherAxes: [this.getOtherAxis(baseAxis)]\n };\n };\n /**\n * Convert a single data item to (x, y) point.\n * Parameter data is an array which the first element is radius and the second is angle\n */\n\n\n Polar.prototype.dataToPoint = function (data, clamp) {\n return this.coordToPoint([this._radiusAxis.dataToRadius(data[0], clamp), this._angleAxis.dataToAngle(data[1], clamp)]);\n };\n /**\n * Convert a (x, y) point to data\n */\n\n\n Polar.prototype.pointToData = function (point, clamp) {\n var coord = this.pointToCoord(point);\n return [this._radiusAxis.radiusToData(coord[0], clamp), this._angleAxis.angleToData(coord[1], clamp)];\n };\n /**\n * Convert a (x, y) point to (radius, angle) coord\n */\n\n\n Polar.prototype.pointToCoord = function (point) {\n var dx = point[0] - this.cx;\n var dy = point[1] - this.cy;\n var angleAxis = this.getAngleAxis();\n var extent = angleAxis.getExtent();\n var minAngle = Math.min(extent[0], extent[1]);\n var maxAngle = Math.max(extent[0], extent[1]); // Fix fixed extent in polarCreator\n // FIXME\n\n angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360;\n var radius = Math.sqrt(dx * dx + dy * dy);\n dx /= radius;\n dy /= radius;\n var radian = Math.atan2(-dy, dx) / Math.PI * 180; // move to angleExtent\n\n var dir = radian < minAngle ? 1 : -1;\n\n while (radian < minAngle || radian > maxAngle) {\n radian += dir * 360;\n }\n\n return [radius, radian];\n };\n /**\n * Convert a (radius, angle) coord to (x, y) point\n */\n\n\n Polar.prototype.coordToPoint = function (coord) {\n var radius = coord[0];\n var radian = coord[1] / 180 * Math.PI;\n var x = Math.cos(radian) * radius + this.cx; // Inverse the y\n\n var y = -Math.sin(radian) * radius + this.cy;\n return [x, y];\n };\n /**\n * Get ring area of cartesian.\n * Area will have a contain function to determine if a point is in the coordinate system.\n */\n\n\n Polar.prototype.getArea = function () {\n var angleAxis = this.getAngleAxis();\n var radiusAxis = this.getRadiusAxis();\n var radiusExtent = radiusAxis.getExtent().slice();\n radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();\n var angleExtent = angleAxis.getExtent();\n var RADIAN = Math.PI / 180;\n return {\n cx: this.cx,\n cy: this.cy,\n r0: radiusExtent[0],\n r: radiusExtent[1],\n startAngle: -angleExtent[0] * RADIAN,\n endAngle: -angleExtent[1] * RADIAN,\n clockwise: angleAxis.inverse,\n contain: function (x, y) {\n // It's a ring shape.\n // Start angle and end angle don't matter\n var dx = x - this.cx;\n var dy = y - this.cy;\n var d2 = dx * dx + dy * dy;\n var r = this.r;\n var r0 = this.r0;\n return d2 <= r * r && d2 >= r0 * r0;\n }\n };\n };\n\n Polar.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.dataToPoint(value) : null;\n };\n\n Polar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.pointToData(pixel) : null;\n };\n\n return Polar;\n}();\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n var polarModel = finder.polarModel;\n return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\n\nexport default Polar;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO Axis scale\nimport * as zrUtil from 'zrender/lib/core/util';\nimport Polar, { polarDimensions } from './Polar';\nimport { parsePercent } from '../../util/number';\nimport { createScaleByModel, niceScaleExtent, getDataDimensionsOnAxis } from '../../coord/axisHelper';\nimport { SINGLE_REFERRING } from '../../util/model';\n/**\n * Resize method bound to the polar\n */\n\nfunction resizePolar(polar, polarModel, api) {\n var center = polarModel.get('center');\n var width = api.getWidth();\n var height = api.getHeight();\n polar.cx = parsePercent(center[0], width);\n polar.cy = parsePercent(center[1], height);\n var radiusAxis = polar.getRadiusAxis();\n var size = Math.min(width, height) / 2;\n var radius = polarModel.get('radius');\n\n if (radius == null) {\n radius = [0, '100%'];\n } else if (!zrUtil.isArray(radius)) {\n // r0 = 0\n radius = [0, radius];\n }\n\n var parsedRadius = [parsePercent(radius[0], size), parsePercent(radius[1], size)];\n radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);\n}\n/**\n * Update polar\n */\n\n\nfunction updatePolarScale(ecModel, api) {\n var polar = this;\n var angleAxis = polar.getAngleAxis();\n var radiusAxis = polar.getRadiusAxis(); // Reset scale\n\n angleAxis.scale.setExtent(Infinity, -Infinity);\n radiusAxis.scale.setExtent(Infinity, -Infinity);\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.coordinateSystem === polar) {\n var data_1 = seriesModel.getData();\n zrUtil.each(getDataDimensionsOnAxis(data_1, 'radius'), function (dim) {\n radiusAxis.scale.unionExtentFromData(data_1, dim);\n });\n zrUtil.each(getDataDimensionsOnAxis(data_1, 'angle'), function (dim) {\n angleAxis.scale.unionExtentFromData(data_1, dim);\n });\n }\n });\n niceScaleExtent(angleAxis.scale, angleAxis.model);\n niceScaleExtent(radiusAxis.scale, radiusAxis.model); // Fix extent of category angle axis\n\n if (angleAxis.type === 'category' && !angleAxis.onBand) {\n var extent = angleAxis.getExtent();\n var diff = 360 / angleAxis.scale.count();\n angleAxis.inverse ? extent[1] += diff : extent[1] -= diff;\n angleAxis.setExtent(extent[0], extent[1]);\n }\n}\n\nfunction isAngleAxisModel(axisModel) {\n return axisModel.mainType === 'angleAxis';\n}\n/**\n * Set common axis properties\n */\n\n\nfunction setAxis(axis, axisModel) {\n axis.type = axisModel.get('type');\n axis.scale = createScaleByModel(axisModel);\n axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';\n axis.inverse = axisModel.get('inverse');\n\n if (isAngleAxisModel(axisModel)) {\n axis.inverse = axis.inverse !== axisModel.get('clockwise');\n var startAngle = axisModel.get('startAngle');\n axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));\n } // Inject axis instance\n\n\n axisModel.axis = axis;\n axis.model = axisModel;\n}\n\nvar polarCreator = {\n dimensions: polarDimensions,\n create: function (ecModel, api) {\n var polarList = [];\n ecModel.eachComponent('polar', function (polarModel, idx) {\n var polar = new Polar(idx + ''); // Inject resize and update method\n\n polar.update = updatePolarScale;\n var radiusAxis = polar.getRadiusAxis();\n var angleAxis = polar.getAngleAxis();\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n setAxis(radiusAxis, radiusAxisModel);\n setAxis(angleAxis, angleAxisModel);\n resizePolar(polar, polarModel, api);\n polarList.push(polar);\n polarModel.coordinateSystem = polar;\n polar.model = polarModel;\n }); // Inject coordinateSystem to series\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'polar') {\n var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!polarModel) {\n throw new Error('Polar \"' + zrUtil.retrieve(seriesModel.get('polarIndex'), seriesModel.get('polarId'), 0) + '\" not found');\n }\n }\n\n seriesModel.coordinateSystem = polarModel.coordinateSystem;\n }\n });\n return polarList;\n }\n};\nexport default polarCreator;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis';\n\nvar ParallelAxis =\n/** @class */\nfunction (_super) {\n __extends(ParallelAxis, _super);\n\n function ParallelAxis(dim, scale, coordExtent, axisType, axisIndex) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n\n _this.type = axisType || 'value';\n _this.axisIndex = axisIndex;\n return _this;\n }\n\n ParallelAxis.prototype.isHorizontal = function () {\n return this.coordinateSystem.getModel().get('layout') !== 'horizontal';\n };\n\n return ParallelAxis;\n}(Axis);\n\nexport default ParallelAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Parallel Coordinates\n * \n */\nimport * as zrUtil from 'zrender/lib/core/util';\nimport * as matrix from 'zrender/lib/core/matrix';\nimport * as layoutUtil from '../../util/layout';\nimport * as axisHelper from '../../coord/axisHelper';\nimport ParallelAxis from './ParallelAxis';\nimport * as graphic from '../../util/graphic';\nimport * as numberUtil from '../../util/number';\nimport sliderMove from '../../component/helper/sliderMove';\nvar each = zrUtil.each;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathFloor = Math.floor;\nvar mathCeil = Math.ceil;\nvar round = numberUtil.round;\nvar PI = Math.PI;\n\nvar Parallel =\n/** @class */\nfunction () {\n function Parallel(parallelModel, ecModel, api) {\n this.type = 'parallel';\n /**\n * key: dimension\n */\n\n this._axesMap = zrUtil.createHashMap();\n /**\n * key: dimension\n * value: {position: [], rotation, }\n */\n\n this._axesLayout = {};\n this.dimensions = parallelModel.dimensions;\n this._model = parallelModel;\n\n this._init(parallelModel, ecModel, api);\n }\n\n Parallel.prototype._init = function (parallelModel, ecModel, api) {\n var dimensions = parallelModel.dimensions;\n var parallelAxisIndex = parallelModel.parallelAxisIndex;\n each(dimensions, function (dim, idx) {\n var axisIndex = parallelAxisIndex[idx];\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n\n var axis = this._axesMap.set(dim, new ParallelAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisIndex));\n\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse'); // Injection\n\n axisModel.axis = axis;\n axis.model = axisModel;\n axis.coordinateSystem = axisModel.coordinateSystem = this;\n }, this);\n };\n /**\n * Update axis scale after data processed\n */\n\n\n Parallel.prototype.update = function (ecModel, api) {\n this._updateAxesFromSeries(this._model, ecModel);\n };\n\n Parallel.prototype.containPoint = function (point) {\n var layoutInfo = this._makeLayoutInfo();\n\n var axisBase = layoutInfo.axisBase;\n var layoutBase = layoutInfo.layoutBase;\n var pixelDimIndex = layoutInfo.pixelDimIndex;\n var pAxis = point[1 - pixelDimIndex];\n var pLayout = point[pixelDimIndex];\n return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength;\n };\n\n Parallel.prototype.getModel = function () {\n return this._model;\n };\n /**\n * Update properties from series\n */\n\n\n Parallel.prototype._updateAxesFromSeries = function (parallelModel, ecModel) {\n ecModel.eachSeries(function (seriesModel) {\n if (!parallelModel.contains(seriesModel, ecModel)) {\n return;\n }\n\n var data = seriesModel.getData();\n each(this.dimensions, function (dim) {\n var axis = this._axesMap.get(dim);\n\n axis.scale.unionExtentFromData(data, data.mapDimension(dim));\n axisHelper.niceScaleExtent(axis.scale, axis.model);\n }, this);\n }, this);\n };\n /**\n * Resize the parallel coordinate system.\n */\n\n\n Parallel.prototype.resize = function (parallelModel, api) {\n this._rect = layoutUtil.getLayoutRect(parallelModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n\n this._layoutAxes();\n };\n\n Parallel.prototype.getRect = function () {\n return this._rect;\n };\n\n Parallel.prototype._makeLayoutInfo = function () {\n var parallelModel = this._model;\n var rect = this._rect;\n var xy = ['x', 'y'];\n var wh = ['width', 'height'];\n var layout = parallelModel.get('layout');\n var pixelDimIndex = layout === 'horizontal' ? 0 : 1;\n var layoutLength = rect[wh[pixelDimIndex]];\n var layoutExtent = [0, layoutLength];\n var axisCount = this.dimensions.length;\n var axisExpandWidth = restrict(parallelModel.get('axisExpandWidth'), layoutExtent);\n var axisExpandCount = restrict(parallelModel.get('axisExpandCount') || 0, [0, axisCount]);\n var axisExpandable = parallelModel.get('axisExpandable') && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0; // `axisExpandWindow` is According to the coordinates of [0, axisExpandLength],\n // for sake of consider the case that axisCollapseWidth is 0 (when screen is narrow),\n // where collapsed axes should be overlapped.\n\n var axisExpandWindow = parallelModel.get('axisExpandWindow');\n var winSize;\n\n if (!axisExpandWindow) {\n winSize = restrict(axisExpandWidth * (axisExpandCount - 1), layoutExtent);\n var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor(axisCount / 2);\n axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\n } else {\n winSize = restrict(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);\n axisExpandWindow[1] = axisExpandWindow[0] + winSize;\n }\n\n var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount); // Avoid axisCollapseWidth is too small.\n\n axisCollapseWidth < 3 && (axisCollapseWidth = 0); // Find the first and last indices > ewin[0] and < ewin[1].\n\n var winInnerIndices = [mathFloor(round(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, mathCeil(round(axisExpandWindow[1] / axisExpandWidth, 1)) - 1]; // Pos in ec coordinates.\n\n var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];\n return {\n layout: layout,\n pixelDimIndex: pixelDimIndex,\n layoutBase: rect[xy[pixelDimIndex]],\n layoutLength: layoutLength,\n axisBase: rect[xy[1 - pixelDimIndex]],\n axisLength: rect[wh[1 - pixelDimIndex]],\n axisExpandable: axisExpandable,\n axisExpandWidth: axisExpandWidth,\n axisCollapseWidth: axisCollapseWidth,\n axisExpandWindow: axisExpandWindow,\n axisCount: axisCount,\n winInnerIndices: winInnerIndices,\n axisExpandWindow0Pos: axisExpandWindow0Pos\n };\n };\n\n Parallel.prototype._layoutAxes = function () {\n var rect = this._rect;\n var axes = this._axesMap;\n var dimensions = this.dimensions;\n\n var layoutInfo = this._makeLayoutInfo();\n\n var layout = layoutInfo.layout;\n axes.each(function (axis) {\n var axisExtent = [0, layoutInfo.axisLength];\n var idx = axis.inverse ? 1 : 0;\n axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);\n });\n each(dimensions, function (dim, idx) {\n var posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo);\n var positionTable = {\n horizontal: {\n x: posInfo.position,\n y: layoutInfo.axisLength\n },\n vertical: {\n x: 0,\n y: posInfo.position\n }\n };\n var rotationTable = {\n horizontal: PI / 2,\n vertical: 0\n };\n var position = [positionTable[layout].x + rect.x, positionTable[layout].y + rect.y];\n var rotation = rotationTable[layout];\n var transform = matrix.create();\n matrix.rotate(transform, transform, rotation);\n matrix.translate(transform, transform, position); // TODO\n // tick layout info\n // TODO\n // update dimensions info based on axis order.\n\n this._axesLayout[dim] = {\n position: position,\n rotation: rotation,\n transform: transform,\n axisNameAvailableWidth: posInfo.axisNameAvailableWidth,\n axisLabelShow: posInfo.axisLabelShow,\n nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,\n tickDirection: 1,\n labelDirection: 1\n };\n }, this);\n };\n /**\n * Get axis by dim.\n */\n\n\n Parallel.prototype.getAxis = function (dim) {\n return this._axesMap.get(dim);\n };\n /**\n * Convert a dim value of a single item of series data to Point.\n */\n\n\n Parallel.prototype.dataToPoint = function (value, dim) {\n return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim);\n };\n /**\n * Travel data for one time, get activeState of each data item.\n * @param start the start dataIndex that travel from.\n * @param end the next dataIndex of the last dataIndex will be travel.\n */\n\n\n Parallel.prototype.eachActiveState = function (data, callback, start, end) {\n start == null && (start = 0);\n end == null && (end = data.count());\n var axesMap = this._axesMap;\n var dimensions = this.dimensions;\n var dataDimensions = [];\n var axisModels = [];\n zrUtil.each(dimensions, function (axisDim) {\n dataDimensions.push(data.mapDimension(axisDim));\n axisModels.push(axesMap.get(axisDim).model);\n });\n var hasActiveSet = this.hasAxisBrushed();\n\n for (var dataIndex = start; dataIndex < end; dataIndex++) {\n var activeState = void 0;\n\n if (!hasActiveSet) {\n activeState = 'normal';\n } else {\n activeState = 'active';\n var values = data.getValues(dataDimensions, dataIndex);\n\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\n var state = axisModels[j].getActiveState(values[j]);\n\n if (state === 'inactive') {\n activeState = 'inactive';\n break;\n }\n }\n }\n\n callback(activeState, dataIndex);\n }\n };\n /**\n * Whether has any activeSet.\n */\n\n\n Parallel.prototype.hasAxisBrushed = function () {\n var dimensions = this.dimensions;\n var axesMap = this._axesMap;\n var hasActiveSet = false;\n\n for (var j = 0, lenj = dimensions.length; j < lenj; j++) {\n if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') {\n hasActiveSet = true;\n }\n }\n\n return hasActiveSet;\n };\n /**\n * Convert coords of each axis to Point.\n * Return point. For example: [10, 20]\n */\n\n\n Parallel.prototype.axisCoordToPoint = function (coord, dim) {\n var axisLayout = this._axesLayout[dim];\n return graphic.applyTransform([coord, 0], axisLayout.transform);\n };\n /**\n * Get axis layout.\n */\n\n\n Parallel.prototype.getAxisLayout = function (dim) {\n return zrUtil.clone(this._axesLayout[dim]);\n };\n /**\n * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}.\n */\n\n\n Parallel.prototype.getSlidedAxisExpandWindow = function (point) {\n var layoutInfo = this._makeLayoutInfo();\n\n var pixelDimIndex = layoutInfo.pixelDimIndex;\n var axisExpandWindow = layoutInfo.axisExpandWindow.slice();\n var winSize = axisExpandWindow[1] - axisExpandWindow[0];\n var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)]; // Out of the area of coordinate system.\n\n if (!this.containPoint(point)) {\n return {\n behavior: 'none',\n axisExpandWindow: axisExpandWindow\n };\n } // Conver the point from global to expand coordinates.\n\n\n var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos; // For dragging operation convenience, the window should not be\n // slided when mouse is the center area of the window.\n\n var delta;\n var behavior = 'slide';\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\n\n var triggerArea = this._model.get('axisExpandSlideTriggerArea'); // But consider touch device, jump is necessary.\n\n\n var useJump = triggerArea[0] != null;\n\n if (axisCollapseWidth) {\n if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {\n behavior = 'jump';\n delta = pointCoord - winSize * triggerArea[2];\n } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {\n behavior = 'jump';\n delta = pointCoord - winSize * (1 - triggerArea[2]);\n } else {\n (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0);\n }\n\n delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;\n delta ? sliderMove(delta, axisExpandWindow, extent, 'all') // Avoid nonsense triger on mousemove.\n : behavior = 'none';\n } // When screen is too narrow, make it visible and slidable, although it is hard to interact.\n else {\n var winSize2 = axisExpandWindow[1] - axisExpandWindow[0];\n var pos = extent[1] * pointCoord / winSize2;\n axisExpandWindow = [mathMax(0, pos - winSize2 / 2)];\n axisExpandWindow[1] = mathMin(extent[1], axisExpandWindow[0] + winSize2);\n axisExpandWindow[0] = axisExpandWindow[1] - winSize2;\n }\n\n return {\n axisExpandWindow: axisExpandWindow,\n behavior: behavior\n };\n };\n\n return Parallel;\n}();\n\nfunction restrict(len, extent) {\n return mathMin(mathMax(len, extent[0]), extent[1]);\n}\n\nfunction layoutAxisWithoutExpand(axisIndex, layoutInfo) {\n var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);\n return {\n position: step * axisIndex,\n axisNameAvailableWidth: step,\n axisLabelShow: true\n };\n}\n\nfunction layoutAxisWithExpand(axisIndex, layoutInfo) {\n var layoutLength = layoutInfo.layoutLength;\n var axisExpandWidth = layoutInfo.axisExpandWidth;\n var axisCount = layoutInfo.axisCount;\n var axisCollapseWidth = layoutInfo.axisCollapseWidth;\n var winInnerIndices = layoutInfo.winInnerIndices;\n var position;\n var axisNameAvailableWidth = axisCollapseWidth;\n var axisLabelShow = false;\n var nameTruncateMaxWidth;\n\n if (axisIndex < winInnerIndices[0]) {\n position = axisIndex * axisCollapseWidth;\n nameTruncateMaxWidth = axisCollapseWidth;\n } else if (axisIndex <= winInnerIndices[1]) {\n position = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];\n axisNameAvailableWidth = axisExpandWidth;\n axisLabelShow = true;\n } else {\n position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;\n nameTruncateMaxWidth = axisCollapseWidth;\n }\n\n return {\n position: position,\n axisNameAvailableWidth: axisNameAvailableWidth,\n axisLabelShow: axisLabelShow,\n nameTruncateMaxWidth: nameTruncateMaxWidth\n };\n}\n\nexport default Parallel;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Parallel coordinate system creater.\n */\nimport Parallel from './Parallel';\nimport { SINGLE_REFERRING } from '../../util/model';\n\nfunction createParallelCoordSys(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = seriesModel.getReferringComponents('parallel', SINGLE_REFERRING).models[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}\n\nvar parallelCoordSysCreator = {\n create: createParallelCoordSys\n};\nexport default parallelCoordSysCreator;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis';\n\nvar SingleAxis =\n/** @class */\nfunction (_super) {\n __extends(SingleAxis, _super);\n\n function SingleAxis(dim, scale, coordExtent, axisType, position) {\n var _this = _super.call(this, dim, scale, coordExtent) || this;\n\n _this.type = axisType || 'value';\n _this.position = position || 'bottom';\n return _this;\n }\n /**\n * Judge the orient of the axis.\n */\n\n\n SingleAxis.prototype.isHorizontal = function () {\n var position = this.position;\n return position === 'top' || position === 'bottom';\n };\n\n SingleAxis.prototype.pointToData = function (point, clamp) {\n return this.coordinateSystem.pointToData(point)[0];\n };\n\n return SingleAxis;\n}(Axis);\n\nexport default SingleAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Single coordinates system.\n */\nimport SingleAxis from './SingleAxis';\nimport * as axisHelper from '../axisHelper';\nimport { getLayoutRect } from '../../util/layout';\nimport { each } from 'zrender/lib/core/util';\nexport var singleDimensions = ['single'];\n/**\n * Create a single coordinates system.\n */\n\nvar Single =\n/** @class */\nfunction () {\n function Single(axisModel, ecModel, api) {\n this.type = 'single';\n this.dimension = 'single';\n /**\n * Add it just for draw tooltip.\n */\n\n this.dimensions = singleDimensions;\n this.axisPointerEnabled = true;\n this.model = axisModel;\n\n this._init(axisModel, ecModel, api);\n }\n /**\n * Initialize single coordinate system.\n */\n\n\n Single.prototype._init = function (axisModel, ecModel, api) {\n var dim = this.dimension;\n var axis = new SingleAxis(dim, axisHelper.createScaleByModel(axisModel), [0, 0], axisModel.get('type'), axisModel.get('position'));\n var isCategory = axis.type === 'category';\n axis.onBand = isCategory && axisModel.get('boundaryGap');\n axis.inverse = axisModel.get('inverse');\n axis.orient = axisModel.get('orient');\n axisModel.axis = axis;\n axis.model = axisModel;\n axis.coordinateSystem = this;\n this._axis = axis;\n };\n /**\n * Update axis scale after data processed\n */\n\n\n Single.prototype.update = function (ecModel, api) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.coordinateSystem === this) {\n var data_1 = seriesModel.getData();\n each(data_1.mapDimensionsAll(this.dimension), function (dim) {\n this._axis.scale.unionExtentFromData(data_1, dim);\n }, this);\n axisHelper.niceScaleExtent(this._axis.scale, this._axis.model);\n }\n }, this);\n };\n /**\n * Resize the single coordinate system.\n */\n\n\n Single.prototype.resize = function (axisModel, api) {\n this._rect = getLayoutRect({\n left: axisModel.get('left'),\n top: axisModel.get('top'),\n right: axisModel.get('right'),\n bottom: axisModel.get('bottom'),\n width: axisModel.get('width'),\n height: axisModel.get('height')\n }, {\n width: api.getWidth(),\n height: api.getHeight()\n });\n\n this._adjustAxis();\n };\n\n Single.prototype.getRect = function () {\n return this._rect;\n };\n\n Single.prototype._adjustAxis = function () {\n var rect = this._rect;\n var axis = this._axis;\n var isHorizontal = axis.isHorizontal();\n var extent = isHorizontal ? [0, rect.width] : [0, rect.height];\n var idx = axis.reverse ? 1 : 0;\n axis.setExtent(extent[idx], extent[1 - idx]);\n\n this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y);\n };\n\n Single.prototype._updateAxisTransform = function (axis, coordBase) {\n var axisExtent = axis.getExtent();\n var extentSum = axisExtent[0] + axisExtent[1];\n var isHorizontal = axis.isHorizontal();\n axis.toGlobalCoord = isHorizontal ? function (coord) {\n return coord + coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n axis.toLocalCoord = isHorizontal ? function (coord) {\n return coord - coordBase;\n } : function (coord) {\n return extentSum - coord + coordBase;\n };\n };\n /**\n * Get axis.\n */\n\n\n Single.prototype.getAxis = function () {\n return this._axis;\n };\n /**\n * Get axis, add it just for draw tooltip.\n */\n\n\n Single.prototype.getBaseAxis = function () {\n return this._axis;\n };\n\n Single.prototype.getAxes = function () {\n return [this._axis];\n };\n\n Single.prototype.getTooltipAxes = function () {\n return {\n baseAxes: [this.getAxis()],\n // Empty otherAxes\n otherAxes: []\n };\n };\n /**\n * If contain point.\n */\n\n\n Single.prototype.containPoint = function (point) {\n var rect = this.getRect();\n var axis = this.getAxis();\n var orient = axis.orient;\n\n if (orient === 'horizontal') {\n return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n } else {\n return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height;\n }\n };\n\n Single.prototype.pointToData = function (point) {\n var axis = this.getAxis();\n return [axis.coordToData(axis.toLocalCoord(point[axis.orient === 'horizontal' ? 0 : 1]))];\n };\n /**\n * Convert the series data to concrete point.\n * Can be [val] | val\n */\n\n\n Single.prototype.dataToPoint = function (val) {\n var axis = this.getAxis();\n var rect = this.getRect();\n var pt = [];\n var idx = axis.orient === 'horizontal' ? 0 : 1;\n\n if (val instanceof Array) {\n val = val[0];\n }\n\n pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));\n pt[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2;\n return pt;\n };\n\n Single.prototype.convertToPixel = function (ecModel, finder, value) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.dataToPoint(value) : null;\n };\n\n Single.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n var coordSys = getCoordSys(finder);\n return coordSys === this ? this.pointToData(pixel) : null;\n };\n\n return Single;\n}();\n\nfunction getCoordSys(finder) {\n var seriesModel = finder.seriesModel;\n var singleModel = finder.singleAxisModel;\n return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;\n}\n\nexport default Single;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Single coordinate system creator.\n */\nimport Single, { singleDimensions } from './Single';\nimport { SINGLE_REFERRING } from '../../util/model';\n/**\n * Create single coordinate system and inject it into seriesModel.\n */\n\nfunction create(ecModel, api) {\n var singles = [];\n ecModel.eachComponent('singleAxis', function (axisModel, idx) {\n var single = new Single(axisModel, ecModel, api);\n single.name = 'single_' + idx;\n single.resize(axisModel, api);\n axisModel.coordinateSystem = single;\n singles.push(single);\n });\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'singleAxis') {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis', SINGLE_REFERRING).models[0];\n seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;\n }\n });\n return singles;\n}\n\nvar singleCreator = {\n create: create,\n dimensions: singleDimensions\n};\nexport default singleCreator;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { __extends } from \"tslib\";\nimport Axis from '../Axis';\n\nvar IndicatorAxis =\n/** @class */\nfunction (_super) {\n __extends(IndicatorAxis, _super);\n\n function IndicatorAxis(dim, scale, radiusExtent) {\n var _this = _super.call(this, dim, scale, radiusExtent) || this;\n\n _this.type = 'value';\n _this.angle = 0;\n _this.name = '';\n return _this;\n }\n\n return IndicatorAxis;\n}(Axis);\n\nexport default IndicatorAxis;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// TODO clockwise\nimport IndicatorAxis from './IndicatorAxis';\nimport IntervalScale from '../../scale/Interval';\nimport * as numberUtil from '../../util/number';\nimport { getScaleExtent, niceScaleExtent } from '../axisHelper';\nimport { parseAxisModelMinMax } from '../scaleRawExtentInfo';\nimport { map, each } from 'zrender/lib/core/util';\n\nvar Radar =\n/** @class */\nfunction () {\n function Radar(radarModel, ecModel, api) {\n /**\n *\n * Radar dimensions\n */\n this.dimensions = [];\n this._model = radarModel;\n this._indicatorAxes = map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {\n var dim = 'indicator_' + idx;\n var indicatorAxis = new IndicatorAxis(dim, new IntervalScale() // (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale()\n );\n indicatorAxis.name = indicatorModel.get('name'); // Inject model and axis\n\n indicatorAxis.model = indicatorModel;\n indicatorModel.axis = indicatorAxis;\n this.dimensions.push(dim);\n return indicatorAxis;\n }, this);\n this.resize(radarModel, api);\n }\n\n Radar.prototype.getIndicatorAxes = function () {\n return this._indicatorAxes;\n };\n\n Radar.prototype.dataToPoint = function (value, indicatorIndex) {\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\n return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);\n }; // TODO: API should be coordToPoint([coord, indicatorIndex])\n\n\n Radar.prototype.coordToPoint = function (coord, indicatorIndex) {\n var indicatorAxis = this._indicatorAxes[indicatorIndex];\n var angle = indicatorAxis.angle;\n var x = this.cx + coord * Math.cos(angle);\n var y = this.cy - coord * Math.sin(angle);\n return [x, y];\n };\n\n Radar.prototype.pointToData = function (pt) {\n var dx = pt[0] - this.cx;\n var dy = pt[1] - this.cy;\n var radius = Math.sqrt(dx * dx + dy * dy);\n dx /= radius;\n dy /= radius;\n var radian = Math.atan2(-dy, dx); // Find the closest angle\n // FIXME index can calculated directly\n\n var minRadianDiff = Infinity;\n var closestAxis;\n var closestAxisIdx = -1;\n\n for (var i = 0; i < this._indicatorAxes.length; i++) {\n var indicatorAxis = this._indicatorAxes[i];\n var diff = Math.abs(radian - indicatorAxis.angle);\n\n if (diff < minRadianDiff) {\n closestAxis = indicatorAxis;\n closestAxisIdx = i;\n minRadianDiff = diff;\n }\n }\n\n return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];\n };\n\n Radar.prototype.resize = function (radarModel, api) {\n var center = radarModel.get('center');\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n var viewSize = Math.min(viewWidth, viewHeight) / 2;\n this.cx = numberUtil.parsePercent(center[0], viewWidth);\n this.cy = numberUtil.parsePercent(center[1], viewHeight);\n this.startAngle = radarModel.get('startAngle') * Math.PI / 180; // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']`\n\n var radius = radarModel.get('radius');\n\n if (typeof radius === 'string' || typeof radius === 'number') {\n radius = [0, radius];\n }\n\n this.r0 = numberUtil.parsePercent(radius[0], viewSize);\n this.r = numberUtil.parsePercent(radius[1], viewSize);\n each(this._indicatorAxes, function (indicatorAxis, idx) {\n indicatorAxis.setExtent(this.r0, this.r);\n var angle = this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length; // Normalize to [-PI, PI]\n\n angle = Math.atan2(Math.sin(angle), Math.cos(angle));\n indicatorAxis.angle = angle;\n }, this);\n };\n\n Radar.prototype.update = function (ecModel, api) {\n var indicatorAxes = this._indicatorAxes;\n var radarModel = this._model;\n each(indicatorAxes, function (indicatorAxis) {\n indicatorAxis.scale.setExtent(Infinity, -Infinity);\n });\n ecModel.eachSeriesByType('radar', function (radarSeries, idx) {\n if (radarSeries.get('coordinateSystem') !== 'radar' // @ts-ignore\n || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel) {\n return;\n }\n\n var data = radarSeries.getData();\n each(indicatorAxes, function (indicatorAxis) {\n indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));\n });\n }, this);\n var splitNumber = radarModel.get('splitNumber');\n\n function increaseInterval(interval) {\n var exp10 = Math.pow(10, Math.floor(Math.log(interval) / Math.LN10)); // Increase interval\n\n var f = interval / exp10;\n\n if (f === 2) {\n f = 5;\n } else {\n // f is 2 or 5\n f *= 2;\n }\n\n return f * exp10;\n } // Force all the axis fixing the maxSplitNumber.\n\n\n each(indicatorAxes, function (indicatorAxis, idx) {\n var rawExtent = getScaleExtent(indicatorAxis.scale, indicatorAxis.model).extent;\n niceScaleExtent(indicatorAxis.scale, indicatorAxis.model);\n var axisModel = indicatorAxis.model;\n var scale = indicatorAxis.scale;\n var fixedMin = parseAxisModelMinMax(scale, axisModel.get('min', true));\n var fixedMax = parseAxisModelMinMax(scale, axisModel.get('max', true));\n var interval = scale.getInterval();\n\n if (fixedMin != null && fixedMax != null) {\n // User set min, max, divide to get new interval\n scale.setExtent(+fixedMin, +fixedMax);\n scale.setInterval((fixedMax - fixedMin) / splitNumber);\n } else if (fixedMin != null) {\n var max = void 0; // User set min, expand extent on the other side\n\n do {\n max = fixedMin + interval * splitNumber;\n scale.setExtent(+fixedMin, max); // Interval must been set after extent\n // FIXME\n\n scale.setInterval(interval);\n interval = increaseInterval(interval);\n } while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1]));\n } else if (fixedMax != null) {\n var min = void 0; // User set min, expand extent on the other side\n\n do {\n min = fixedMax - interval * splitNumber;\n scale.setExtent(min, +fixedMax);\n scale.setInterval(interval);\n interval = increaseInterval(interval);\n } while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0]));\n } else {\n var nicedSplitNumber = scale.getTicks().length - 1;\n\n if (nicedSplitNumber > splitNumber) {\n interval = increaseInterval(interval);\n } // TODO\n\n\n var max = Math.ceil(rawExtent[1] / interval) * interval;\n var min = numberUtil.round(max - interval * splitNumber);\n scale.setExtent(min, max);\n scale.setInterval(interval);\n }\n });\n };\n\n Radar.prototype.convertToPixel = function (ecModel, finder, value) {\n console.warn('Not implemented.');\n return null;\n };\n\n Radar.prototype.convertFromPixel = function (ecModel, finder, pixel) {\n console.warn('Not implemented.');\n return null;\n };\n\n Radar.prototype.containPoint = function (point) {\n console.warn('Not implemented.');\n return false;\n };\n\n Radar.create = function (ecModel, api) {\n var radarList = [];\n ecModel.eachComponent('radar', function (radarModel) {\n var radar = new Radar(radarModel, ecModel, api);\n radarList.push(radar);\n radarModel.coordinateSystem = radar;\n });\n ecModel.eachSeriesByType('radar', function (radarSeries) {\n if (radarSeries.get('coordinateSystem') === 'radar') {\n // Inject coordinate system\n // @ts-ignore\n radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0];\n }\n });\n return radarList;\n };\n /**\n * Radar dimensions is based on the data\n */\n\n\n Radar.dimensions = [];\n return Radar;\n}();\n\nexport default Radar;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/* global Int32Array */\nimport * as zrUtil from 'zrender/lib/core/util';\nimport Model from '../model/Model';\nimport DataDiffer from './DataDiffer';\nimport { DefaultDataProvider } from './helper/dataProvider';\nimport { summarizeDimensions } from './helper/dimensionHelper';\nimport SeriesDimensionDefine from './SeriesDimensionDefine';\nimport { SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ORIGINAL } from '../util/types';\nimport { convertOptionIdName, isDataItemOption } from '../util/model';\nimport { setCommonECData } from '../util/innerStore';\nimport { isSourceInstance } from './Source';\nimport DataStore from './DataStore';\nimport { isSeriesDataSchema } from './helper/SeriesDataSchema';\nvar isObject = zrUtil.isObject;\nvar map = zrUtil.map;\nvar CtorInt32Array = typeof Int32Array === 'undefined' ? Array : Int32Array; // Use prefix to avoid index to be the same as otherIdList[idx],\n// which will cause weird udpate animation.\n\nvar ID_PREFIX = 'e\\0\\0';\nvar INDEX_NOT_FOUND = -1; // type SeriesDimensionIndex = DimensionIndex;\n\nvar TRANSFERABLE_PROPERTIES = ['hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', '_dimSummary', 'userOutput', '_rawData', '_dimValueGetter', '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'];\nvar CLONE_PROPERTIES = ['_approximateExtent']; // -----------------------------\n// Internal method declarations:\n// -----------------------------\n\nvar prepareInvertedIndex;\nvar getId;\nvar getIdNameFromStore;\nvar normalizeDimensions;\nvar transferProperties;\nvar cloneListForMapAndSample;\nvar makeIdFromName;\n\nvar SeriesData =\n/** @class */\nfunction () {\n /**\n * @param dimensionsInput.dimensions\n * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...].\n * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius\n */\n function SeriesData(dimensionsInput, hostModel) {\n this.type = 'list';\n this._dimOmitted = false;\n this._nameList = [];\n this._idList = []; // Models of data option is stored sparse for optimizing memory cost\n // Never used yet (not used yet).\n // private _optionModels: Model[] = [];\n // Global visual properties after visual coding\n\n this._visual = {}; // Globel layout properties.\n\n this._layout = {}; // Item visual properties after visual coding\n\n this._itemVisuals = []; // Item layout properties after layout\n\n this._itemLayouts = []; // Graphic elemnents\n\n this._graphicEls = []; // key: dim, value: extent\n\n this._approximateExtent = {};\n this._calculationInfo = {}; // Having detected that there is data item is non primitive type\n // (in type `OptionDataItemObject`).\n // Like `data: [ { value: xx, itemStyle: {...} }, ...]`\n // At present it only happen in `SOURCE_FORMAT_ORIGINAL`.\n\n this.hasItemOption = false; // Methods that create a new list based on this list should be listed here.\n // Notice that those method should `RETURN` the new list.\n\n this.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'lttbDownSample', 'map']; // Methods that change indices of this list should be listed here.\n\n this.CHANGABLE_METHODS = ['filterSelf', 'selectRange'];\n this.DOWNSAMPLE_METHODS = ['downSample', 'lttbDownSample'];\n var dimensions;\n var assignStoreDimIdx = false;\n\n if (isSeriesDataSchema(dimensionsInput)) {\n dimensions = dimensionsInput.dimensions;\n this._dimOmitted = dimensionsInput.isDimensionOmitted();\n this._schema = dimensionsInput;\n } else {\n assignStoreDimIdx = true;\n dimensions = dimensionsInput;\n }\n\n dimensions = dimensions || ['x', 'y'];\n var dimensionInfos = {};\n var dimensionNames = [];\n var invertedIndicesMap = {};\n var needsHasOwn = false;\n var emptyObj = {};\n\n for (var i = 0; i < dimensions.length; i++) {\n // Use the original dimensions[i], where other flag props may exists.\n var dimInfoInput = dimensions[i];\n var dimensionInfo = zrUtil.isString(dimInfoInput) ? new SeriesDimensionDefine({\n name: dimInfoInput\n }) : !(dimInfoInput instanceof SeriesDimensionDefine) ? new SeriesDimensionDefine(dimInfoInput) : dimInfoInput;\n var dimensionName = dimensionInfo.name;\n dimensionInfo.type = dimensionInfo.type || 'float';\n\n if (!dimensionInfo.coordDim) {\n dimensionInfo.coordDim = dimensionName;\n dimensionInfo.coordDimIndex = 0;\n }\n\n var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};\n dimensionNames.push(dimensionName);\n dimensionInfos[dimensionName] = dimensionInfo;\n\n if (emptyObj[dimensionName] != null) {\n needsHasOwn = true;\n }\n\n if (dimensionInfo.createInvertedIndices) {\n invertedIndicesMap[dimensionName] = [];\n }\n\n if (otherDims.itemName === 0) {\n this._nameDimIdx = i;\n }\n\n if (otherDims.itemId === 0) {\n this._idDimIdx = i;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.assert(assignStoreDimIdx || dimensionInfo.storeDimIndex >= 0);\n }\n\n if (assignStoreDimIdx) {\n dimensionInfo.storeDimIndex = i;\n }\n }\n\n this.dimensions = dimensionNames;\n this._dimInfos = dimensionInfos;\n\n this._initGetDimensionInfo(needsHasOwn);\n\n this.hostModel = hostModel;\n this._invertedIndicesMap = invertedIndicesMap;\n\n if (this._dimOmitted) {\n var dimIdxToName_1 = this._dimIdxToName = zrUtil.createHashMap();\n zrUtil.each(dimensionNames, function (dimName) {\n dimIdxToName_1.set(dimensionInfos[dimName].storeDimIndex, dimName);\n });\n }\n }\n /**\n *\n * Get concrete dimension name by dimension name or dimension index.\n * If input a dimension name, do not validate whether the dimension name exits.\n *\n * @caution\n * @param dim Must make sure the dimension is `SeriesDimensionLoose`.\n * Because only those dimensions will have auto-generated dimension names if not\n * have a user-specified name, and other dimensions will get a return of null/undefined.\n *\n * @notice Becuause of this reason, should better use `getDimensionIndex` instead, for examples:\n * ```js\n * const val = data.getStore().get(data.getDimensionIndex(dim), dataIdx);\n * ```\n *\n * @return Concrete dim name.\n */\n\n\n SeriesData.prototype.getDimension = function (dim) {\n var dimIdx = this._recognizeDimIndex(dim);\n\n if (dimIdx == null) {\n return dim;\n }\n\n dimIdx = dim;\n\n if (!this._dimOmitted) {\n return this.dimensions[dimIdx];\n } // Retrieve from series dimension definition becuase it probably contains\n // generated dimension name (like 'x', 'y').\n\n\n var dimName = this._dimIdxToName.get(dimIdx);\n\n if (dimName != null) {\n return dimName;\n }\n\n var sourceDimDef = this._schema.getSourceDimension(dimIdx);\n\n if (sourceDimDef) {\n return sourceDimDef.name;\n }\n };\n /**\n * Get dimension index in data store. Return -1 if not found.\n * Can be used to index value from getRawValue.\n */\n\n\n SeriesData.prototype.getDimensionIndex = function (dim) {\n var dimIdx = this._recognizeDimIndex(dim);\n\n if (dimIdx != null) {\n return dimIdx;\n }\n\n if (dim == null) {\n return -1;\n }\n\n var dimInfo = this._getDimInfo(dim);\n\n return dimInfo ? dimInfo.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(dim) : -1;\n };\n /**\n * The meanings of the input parameter `dim`:\n *\n * + If dim is a number (e.g., `1`), it means the index of the dimension.\n * For example, `getDimension(0)` will return 'x' or 'lng' or 'radius'.\n * + If dim is a number-like string (e.g., `\"1\"`):\n * + If there is the same concrete dim name defined in `series.dimensions` or `dataset.dimensions`,\n * it means that concrete name.\n * + If not, it will be converted to a number, which means the index of the dimension.\n * (why? because of the backward compatbility. We have been tolerating number-like string in\n * dimension setting, although now it seems that it is not a good idea.)\n * For example, `visualMap[i].dimension: \"1\"` is the same meaning as `visualMap[i].dimension: 1`,\n * if no dimension name is defined as `\"1\"`.\n * + If dim is a not-number-like string, it means the concrete dim name.\n * For example, it can be be default name `\"x\"`, `\"y\"`, `\"z\"`, `\"lng\"`, `\"lat\"`, `\"angle\"`, `\"radius\"`,\n * or customized in `dimensions` property of option like `\"age\"`.\n *\n * @return recogonized `DimensionIndex`. Otherwise return null/undefined (means that dim is `DimensionName`).\n */\n\n\n SeriesData.prototype._recognizeDimIndex = function (dim) {\n if (typeof dim === 'number' // If being a number-like string but not being defined as a dimension name.\n || dim != null && !isNaN(dim) && !this._getDimInfo(dim) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0)) {\n return +dim;\n }\n };\n\n SeriesData.prototype._getStoreDimIndex = function (dim) {\n var dimIdx = this.getDimensionIndex(dim);\n\n if (process.env.NODE_ENV !== 'production') {\n if (dimIdx == null) {\n throw new Error('Unkown dimension ' + dim);\n }\n }\n\n return dimIdx;\n };\n /**\n * Get type and calculation info of particular dimension\n * @param dim\n * Dimension can be concrete names like x, y, z, lng, lat, angle, radius\n * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'\n */\n\n\n SeriesData.prototype.getDimensionInfo = function (dim) {\n // Do not clone, because there may be categories in dimInfo.\n return this._getDimInfo(this.getDimension(dim));\n };\n\n SeriesData.prototype._initGetDimensionInfo = function (needsHasOwn) {\n var dimensionInfos = this._dimInfos;\n this._getDimInfo = needsHasOwn ? function (dimName) {\n return dimensionInfos.hasOwnProperty(dimName) ? dimensionInfos[dimName] : undefined;\n } : function (dimName) {\n return dimensionInfos[dimName];\n };\n };\n /**\n * concrete dimension name list on coord.\n */\n\n\n SeriesData.prototype.getDimensionsOnCoord = function () {\n return this._dimSummary.dataDimsOnCoord.slice();\n };\n\n SeriesData.prototype.mapDimension = function (coordDim, idx) {\n var dimensionsSummary = this._dimSummary;\n\n if (idx == null) {\n return dimensionsSummary.encodeFirstDimNotExtra[coordDim];\n }\n\n var dims = dimensionsSummary.encode[coordDim];\n return dims ? dims[idx] : null;\n };\n\n SeriesData.prototype.mapDimensionsAll = function (coordDim) {\n var dimensionsSummary = this._dimSummary;\n var dims = dimensionsSummary.encode[coordDim];\n return (dims || []).slice();\n };\n\n SeriesData.prototype.getStore = function () {\n return this._store;\n };\n /**\n * Initialize from data\n * @param data source or data or data store.\n * @param nameList The name of a datum is used on data diff and\n * default label/tooltip.\n * A name can be specified in encode.itemName,\n * or dataItem.name (only for series option data),\n * or provided in nameList from outside.\n */\n\n\n SeriesData.prototype.initData = function (data, nameList, dimValueGetter) {\n var _this = this;\n\n var store;\n\n if (data instanceof DataStore) {\n store = data;\n }\n\n if (!store) {\n var dimensions = this.dimensions;\n var provider = isSourceInstance(data) || zrUtil.isArrayLike(data) ? new DefaultDataProvider(data, dimensions.length) : data;\n store = new DataStore();\n var dimensionInfos = map(dimensions, function (dimName) {\n return {\n type: _this._dimInfos[dimName].type,\n property: dimName\n };\n });\n store.initData(provider, dimensionInfos, dimValueGetter);\n }\n\n this._store = store; // Reset\n\n this._nameList = (nameList || []).slice();\n this._idList = [];\n this._nameRepeatCount = {};\n\n this._doInit(0, store.count()); // Cache summary info for fast visit. See \"dimensionHelper\".\n // Needs to be initialized after store is prepared.\n\n\n this._dimSummary = summarizeDimensions(this, this._schema);\n this.userOutput = this._dimSummary.userOutput;\n };\n /**\n * Caution: Can be only called on raw data (before `this._indices` created).\n */\n\n\n SeriesData.prototype.appendData = function (data) {\n var range = this._store.appendData(data);\n\n this._doInit(range[0], range[1]);\n };\n /**\n * Caution: Can be only called on raw data (before `this._indices` created).\n * This method does not modify `rawData` (`dataProvider`), but only\n * add values to store.\n *\n * The final count will be increased by `Math.max(values.length, names.length)`.\n *\n * @param values That is the SourceType: 'arrayRows', like\n * [\n * [12, 33, 44],\n * [NaN, 43, 1],\n * ['-', 'asdf', 0]\n * ]\n * Each item is exaclty cooresponding to a dimension.\n */\n\n\n SeriesData.prototype.appendValues = function (values, names) {\n var _a = this._store.appendValues(values, names.length),\n start = _a.start,\n end = _a.end;\n\n var shouldMakeIdFromName = this._shouldMakeIdFromName();\n\n this._updateOrdinalMeta();\n\n if (names) {\n for (var idx = start; idx < end; idx++) {\n var sourceIdx = idx - start;\n this._nameList[idx] = names[sourceIdx];\n\n if (shouldMakeIdFromName) {\n makeIdFromName(this, idx);\n }\n }\n }\n };\n\n SeriesData.prototype._updateOrdinalMeta = function () {\n var store = this._store;\n var dimensions = this.dimensions;\n\n for (var i = 0; i < dimensions.length; i++) {\n var dimInfo = this._dimInfos[dimensions[i]];\n\n if (dimInfo.ordinalMeta) {\n store.collectOrdinalMeta(dimInfo.storeDimIndex, dimInfo.ordinalMeta);\n }\n }\n };\n\n SeriesData.prototype._shouldMakeIdFromName = function () {\n var provider = this._store.getProvider();\n\n return this._idDimIdx == null && provider.getSource().sourceFormat !== SOURCE_FORMAT_TYPED_ARRAY && !provider.fillStorage;\n };\n\n SeriesData.prototype._doInit = function (start, end) {\n if (start >= end) {\n return;\n }\n\n var store = this._store;\n var provider = store.getProvider();\n\n this._updateOrdinalMeta();\n\n var nameList = this._nameList;\n var idList = this._idList;\n var sourceFormat = provider.getSource().sourceFormat;\n var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL; // Each data item is value\n // [1, 2]\n // 2\n // Bar chart, line chart which uses category axis\n // only gives the 'y' value. 'x' value is the indices of category\n // Use a tempValue to normalize the value to be a (x, y) value\n // If dataItem is {name: ...} or {id: ...}, it has highest priority.\n // This kind of ids and names are always stored `_nameList` and `_idList`.\n\n if (isFormatOriginal && !provider.pure) {\n var sharedDataItem = [];\n\n for (var idx = start; idx < end; idx++) {\n // NOTICE: Try not to write things into dataItem\n var dataItem = provider.getItem(idx, sharedDataItem);\n\n if (!this.hasItemOption && isDataItemOption(dataItem)) {\n this.hasItemOption = true;\n }\n\n if (dataItem) {\n var itemName = dataItem.name;\n\n if (nameList[idx] == null && itemName != null) {\n nameList[idx] = convertOptionIdName(itemName, null);\n }\n\n var itemId = dataItem.id;\n\n if (idList[idx] == null && itemId != null) {\n idList[idx] = convertOptionIdName(itemId, null);\n }\n }\n }\n }\n\n if (this._shouldMakeIdFromName()) {\n for (var idx = start; idx < end; idx++) {\n makeIdFromName(this, idx);\n }\n }\n\n prepareInvertedIndex(this);\n };\n /**\n * PENDING: In fact currently this function is only used to short-circuit\n * the calling of `scale.unionExtentFromData` when data have been filtered by modules\n * like \"dataZoom\". `scale.unionExtentFromData` is used to calculate data extent for series on\n * an axis, but if a \"axis related data filter module\" is used, the extent of the axis have\n * been fixed and no need to calling `scale.unionExtentFromData` actually.\n * But if we add \"custom data filter\" in future, which is not \"axis related\", this method may\n * be still needed.\n *\n * Optimize for the scenario that data is filtered by a given extent.\n * Consider that if data amount is more than hundreds of thousand,\n * extent calculation will cost more than 10ms and the cache will\n * be erased because of the filtering.\n */\n\n\n SeriesData.prototype.getApproximateExtent = function (dim) {\n return this._approximateExtent[dim] || this._store.getDataExtent(this._getStoreDimIndex(dim));\n };\n /**\n * Calculate extent on a filtered data might be time consuming.\n * Approximate extent is only used for: calculte extent of filtered data outside.\n */\n\n\n SeriesData.prototype.setApproximateExtent = function (extent, dim) {\n dim = this.getDimension(dim);\n this._approximateExtent[dim] = extent.slice();\n };\n\n SeriesData.prototype.getCalculationInfo = function (key) {\n return this._calculationInfo[key];\n };\n\n SeriesData.prototype.setCalculationInfo = function (key, value) {\n isObject(key) ? zrUtil.extend(this._calculationInfo, key) : this._calculationInfo[key] = value;\n };\n /**\n * @return Never be null/undefined. `number` will be converted to string. Becuase:\n * In most cases, name is used in display, where returning a string is more convenient.\n * In other cases, name is used in query (see `indexOfName`), where we can keep the\n * rule that name `2` equals to name `'2'`.\n */\n\n\n SeriesData.prototype.getName = function (idx) {\n var rawIndex = this.getRawIndex(idx);\n var name = this._nameList[rawIndex];\n\n if (name == null && this._nameDimIdx != null) {\n name = getIdNameFromStore(this, this._nameDimIdx, rawIndex);\n }\n\n if (name == null) {\n name = '';\n }\n\n return name;\n };\n\n SeriesData.prototype._getCategory = function (dimIdx, idx) {\n var ordinal = this._store.get(dimIdx, idx);\n\n var ordinalMeta = this._store.getOrdinalMeta(dimIdx);\n\n if (ordinalMeta) {\n return ordinalMeta.categories[ordinal];\n }\n\n return ordinal;\n };\n /**\n * @return Never null/undefined. `number` will be converted to string. Becuase:\n * In all cases having encountered at present, id is used in making diff comparison, which\n * are usually based on hash map. We can keep the rule that the internal id are always string\n * (treat `2` is the same as `'2'`) to make the related logic simple.\n */\n\n\n SeriesData.prototype.getId = function (idx) {\n return getId(this, this.getRawIndex(idx));\n };\n\n SeriesData.prototype.count = function () {\n return this._store.count();\n };\n /**\n * Get value. Return NaN if idx is out of range.\n *\n * @notice Should better to use `data.getStore().get(dimIndex, dataIdx)` instead.\n */\n\n\n SeriesData.prototype.get = function (dim, idx) {\n var store = this._store;\n var dimInfo = this._dimInfos[dim];\n\n if (dimInfo) {\n return store.get(dimInfo.storeDimIndex, idx);\n }\n };\n /**\n * @notice Should better to use `data.getStore().getByRawIndex(dimIndex, dataIdx)` instead.\n */\n\n\n SeriesData.prototype.getByRawIndex = function (dim, rawIdx) {\n var store = this._store;\n var dimInfo = this._dimInfos[dim];\n\n if (dimInfo) {\n return store.getByRawIndex(dimInfo.storeDimIndex, rawIdx);\n }\n };\n\n SeriesData.prototype.getIndices = function () {\n return this._store.getIndices();\n };\n\n SeriesData.prototype.getDataExtent = function (dim) {\n return this._store.getDataExtent(this._getStoreDimIndex(dim));\n };\n\n SeriesData.prototype.getSum = function (dim) {\n return this._store.getSum(this._getStoreDimIndex(dim));\n };\n\n SeriesData.prototype.getMedian = function (dim) {\n return this._store.getMedian(this._getStoreDimIndex(dim));\n };\n\n SeriesData.prototype.getValues = function (dimensions, idx) {\n var _this = this;\n\n var store = this._store;\n return zrUtil.isArray(dimensions) ? store.getValues(map(dimensions, function (dim) {\n return _this._getStoreDimIndex(dim);\n }), idx) : store.getValues(dimensions);\n };\n /**\n * If value is NaN. Inlcuding '-'\n * Only check the coord dimensions.\n */\n\n\n SeriesData.prototype.hasValue = function (idx) {\n var dataDimIndicesOnCoord = this._dimSummary.dataDimIndicesOnCoord;\n\n for (var i = 0, len = dataDimIndicesOnCoord.length; i < len; i++) {\n // Ordinal type originally can be string or number.\n // But when an ordinal type is used on coord, it can\n // not be string but only number. So we can also use isNaN.\n if (isNaN(this._store.get(dataDimIndicesOnCoord[i], idx))) {\n return false;\n }\n }\n\n return true;\n };\n /**\n * Retreive the index with given name\n */\n\n\n SeriesData.prototype.indexOfName = function (name) {\n for (var i = 0, len = this._store.count(); i < len; i++) {\n if (this.getName(i) === name) {\n return i;\n }\n }\n\n return -1;\n };\n\n SeriesData.prototype.getRawIndex = function (idx) {\n return this._store.getRawIndex(idx);\n };\n\n SeriesData.prototype.indexOfRawIndex = function (rawIndex) {\n return this._store.indexOfRawIndex(rawIndex);\n };\n /**\n * Only support the dimension which inverted index created.\n * Do not support other cases until required.\n * @param dim concrete dim\n * @param value ordinal index\n * @return rawIndex\n */\n\n\n SeriesData.prototype.rawIndexOf = function (dim, value) {\n var invertedIndices = dim && this._invertedIndicesMap[dim];\n\n if (process.env.NODE_ENV !== 'production') {\n if (!invertedIndices) {\n throw new Error('Do not supported yet');\n }\n }\n\n var rawIndex = invertedIndices[value];\n\n if (rawIndex == null || isNaN(rawIndex)) {\n return INDEX_NOT_FOUND;\n }\n\n return rawIndex;\n };\n /**\n * Retreive the index of nearest value\n * @param dim\n * @param value\n * @param [maxDistance=Infinity]\n * @return If and only if multiple indices has\n * the same value, they are put to the result.\n */\n\n\n SeriesData.prototype.indicesOfNearest = function (dim, value, maxDistance) {\n return this._store.indicesOfNearest(this._getStoreDimIndex(dim), value, maxDistance);\n };\n\n SeriesData.prototype.each = function (dims, cb, ctx) {\n 'use strict';\n\n if (typeof dims === 'function') {\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n\n this._store.each(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n };\n\n SeriesData.prototype.filterSelf = function (dims, cb, ctx) {\n 'use strict';\n\n if (typeof dims === 'function') {\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n this._store = this._store.filter(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n return this;\n };\n /**\n * Select data in range. (For optimization of filter)\n * (Manually inline code, support 5 million data filtering in data zoom.)\n */\n\n\n SeriesData.prototype.selectRange = function (range) {\n 'use strict';\n\n var _this = this;\n\n var innerRange = {};\n var dims = zrUtil.keys(range);\n var dimIndices = [];\n zrUtil.each(dims, function (dim) {\n var dimIdx = _this._getStoreDimIndex(dim);\n\n innerRange[dimIdx] = range[dim];\n dimIndices.push(dimIdx);\n });\n this._store = this._store.selectRange(innerRange);\n return this;\n };\n /* eslint-enable max-len */\n\n\n SeriesData.prototype.mapArray = function (dims, cb, ctx) {\n 'use strict';\n\n if (typeof dims === 'function') {\n ctx = cb;\n cb = dims;\n dims = [];\n } // ctxCompat just for compat echarts3\n\n\n ctx = ctx || this;\n var result = [];\n this.each(dims, function () {\n result.push(cb && cb.apply(this, arguments));\n }, ctx);\n return result;\n };\n\n SeriesData.prototype.map = function (dims, cb, ctx, ctxCompat) {\n 'use strict'; // ctxCompat just for compat echarts3\n\n var fCtx = ctx || ctxCompat || this;\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);\n var list = cloneListForMapAndSample(this);\n list._store = this._store.map(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n return list;\n };\n\n SeriesData.prototype.modify = function (dims, cb, ctx, ctxCompat) {\n var _this = this; // ctxCompat just for compat echarts3\n\n\n var fCtx = ctx || ctxCompat || this;\n\n if (process.env.NODE_ENV !== 'production') {\n zrUtil.each(normalizeDimensions(dims), function (dim) {\n var dimInfo = _this.getDimensionInfo(dim);\n\n if (!dimInfo.isCalculationCoord) {\n console.error('Danger: only stack dimension can be modified');\n }\n });\n }\n\n var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this); // If do shallow clone here, if there are too many stacked series,\n // it still cost lots of memory, becuase `_store.dimensions` are not shared.\n // We should consider there probably be shallow clone happen in each sereis\n // in consequent filter/map.\n\n this._store.modify(dimIndices, fCtx ? zrUtil.bind(cb, fCtx) : cb);\n };\n /**\n * Large data down sampling on given dimension\n * @param sampleIndex Sample index for name and id\n */\n\n\n SeriesData.prototype.downSample = function (dimension, rate, sampleValue, sampleIndex) {\n var list = cloneListForMapAndSample(this);\n list._store = this._store.downSample(this._getStoreDimIndex(dimension), rate, sampleValue, sampleIndex);\n return list;\n };\n /**\n * Large data down sampling using largest-triangle-three-buckets\n * @param {string} valueDimension\n * @param {number} targetCount\n */\n\n\n SeriesData.prototype.lttbDownSample = function (valueDimension, rate) {\n var list = cloneListForMapAndSample(this);\n list._store = this._store.lttbDownSample(this._getStoreDimIndex(valueDimension), rate);\n return list;\n };\n\n SeriesData.prototype.getRawDataItem = function (idx) {\n return this._store.getRawDataItem(idx);\n };\n /**\n * Get model of one data item.\n */\n // TODO: Type of data item\n\n\n SeriesData.prototype.getItemModel = function (idx) {\n var hostModel = this.hostModel;\n var dataItem = this.getRawDataItem(idx);\n return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);\n };\n /**\n * Create a data differ\n */\n\n\n SeriesData.prototype.diff = function (otherList) {\n var thisList = this;\n return new DataDiffer(otherList ? otherList.getStore().getIndices() : [], this.getStore().getIndices(), function (idx) {\n return getId(otherList, idx);\n }, function (idx) {\n return getId(thisList, idx);\n });\n };\n /**\n * Get visual property.\n */\n\n\n SeriesData.prototype.getVisual = function (key) {\n var visual = this._visual;\n return visual && visual[key];\n };\n\n SeriesData.prototype.setVisual = function (kvObj, val) {\n this._visual = this._visual || {};\n\n if (isObject(kvObj)) {\n zrUtil.extend(this._visual, kvObj);\n } else {\n this._visual[kvObj] = val;\n }\n };\n /**\n * Get visual property of single data item\n */\n // eslint-disable-next-line\n\n\n SeriesData.prototype.getItemVisual = function (idx, key) {\n var itemVisual = this._itemVisuals[idx];\n var val = itemVisual && itemVisual[key];\n\n if (val == null) {\n // Use global visual property\n return this.getVisual(key);\n }\n\n return val;\n };\n /**\n * If exists visual property of single data item\n */\n\n\n SeriesData.prototype.hasItemVisual = function () {\n return this._itemVisuals.length > 0;\n };\n /**\n * Make sure itemVisual property is unique\n */\n // TODO: use key to save visual to reduce memory.\n\n\n SeriesData.prototype.ensureUniqueItemVisual = function (idx, key) {\n var itemVisuals = this._itemVisuals;\n var itemVisual = itemVisuals[idx];\n\n if (!itemVisual) {\n itemVisual = itemVisuals[idx] = {};\n }\n\n var val = itemVisual[key];\n\n if (val == null) {\n val = this.getVisual(key); // TODO Performance?\n\n if (zrUtil.isArray(val)) {\n val = val.slice();\n } else if (isObject(val)) {\n val = zrUtil.extend({}, val);\n }\n\n itemVisual[key] = val;\n }\n\n return val;\n }; // eslint-disable-next-line\n\n\n SeriesData.prototype.setItemVisual = function (idx, key, value) {\n var itemVisual = this._itemVisuals[idx] || {};\n this._itemVisuals[idx] = itemVisual;\n\n if (isObject(key)) {\n zrUtil.extend(itemVisual, key);\n } else {\n itemVisual[key] = value;\n }\n };\n /**\n * Clear itemVisuals and list visual.\n */\n\n\n SeriesData.prototype.clearAllVisual = function () {\n this._visual = {};\n this._itemVisuals = [];\n };\n\n SeriesData.prototype.setLayout = function (key, val) {\n if (isObject(key)) {\n for (var name_1 in key) {\n if (key.hasOwnProperty(name_1)) {\n this.setLayout(name_1, key[name_1]);\n }\n }\n\n return;\n }\n\n this._layout[key] = val;\n };\n /**\n * Get layout property.\n */\n\n\n SeriesData.prototype.getLayout = function (key) {\n return this._layout[key];\n };\n /**\n * Get layout of single data item\n */\n\n\n SeriesData.prototype.getItemLayout = function (idx) {\n return this._itemLayouts[idx];\n };\n /**\n * Set layout of single data item\n */\n\n\n SeriesData.prototype.setItemLayout = function (idx, layout, merge) {\n this._itemLayouts[idx] = merge ? zrUtil.extend(this._itemLayouts[idx] || {}, layout) : layout;\n };\n /**\n * Clear all layout of single data item\n */\n\n\n SeriesData.prototype.clearItemLayouts = function () {\n this._itemLayouts.length = 0;\n };\n /**\n * Set graphic element relative to data. It can be set as null\n */\n\n\n SeriesData.prototype.setItemGraphicEl = function (idx, el) {\n var seriesIndex = this.hostModel && this.hostModel.seriesIndex;\n setCommonECData(seriesIndex, this.dataType, idx, el);\n this._graphicEls[idx] = el;\n };\n\n SeriesData.prototype.getItemGraphicEl = function (idx) {\n return this._graphicEls[idx];\n };\n\n SeriesData.prototype.eachItemGraphicEl = function (cb, context) {\n zrUtil.each(this._graphicEls, function (el, idx) {\n if (el) {\n cb && cb.call(context, el, idx);\n }\n });\n };\n /**\n * Shallow clone a new list except visual and layout properties, and graph elements.\n * New list only change the indices.\n */\n\n\n SeriesData.prototype.cloneShallow = function (list) {\n if (!list) {\n list = new SeriesData(this._schema ? this._schema : map(this.dimensions, this._getDimInfo, this), this.hostModel);\n }\n\n transferProperties(list, this);\n list._store = this._store;\n return list;\n };\n /**\n * Wrap some method to add more feature\n */\n\n\n SeriesData.prototype.wrapMethod = function (methodName, injectFunction) {\n var originalMethod = this[methodName];\n\n if (typeof originalMethod !== 'function') {\n return;\n }\n\n this.__wrappedMethods = this.__wrappedMethods || [];\n\n this.__wrappedMethods.push(methodName);\n\n this[methodName] = function () {\n var res = originalMethod.apply(this, arguments);\n return injectFunction.apply(this, [res].concat(zrUtil.slice(arguments)));\n };\n }; // ----------------------------------------------------------\n // A work around for internal method visiting private member.\n // ----------------------------------------------------------\n\n\n SeriesData.internalField = function () {\n prepareInvertedIndex = function (data) {\n var invertedIndicesMap = data._invertedIndicesMap;\n zrUtil.each(invertedIndicesMap, function (invertedIndices, dim) {\n var dimInfo = data._dimInfos[dim]; // Currently, only dimensions that has ordinalMeta can create inverted indices.\n\n var ordinalMeta = dimInfo.ordinalMeta;\n var store = data._store;\n\n if (ordinalMeta) {\n invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length); // The default value of TypedArray is 0. To avoid miss\n // mapping to 0, we should set it as INDEX_NOT_FOUND.\n\n for (var i = 0; i < invertedIndices.length; i++) {\n invertedIndices[i] = INDEX_NOT_FOUND;\n }\n\n for (var i = 0; i < store.count(); i++) {\n // Only support the case that all values are distinct.\n invertedIndices[store.get(dimInfo.storeDimIndex, i)] = i;\n }\n }\n });\n };\n\n getIdNameFromStore = function (data, dimIdx, idx) {\n return convertOptionIdName(data._getCategory(dimIdx, idx), null);\n };\n /**\n * @see the comment of `List['getId']`.\n */\n\n\n getId = function (data, rawIndex) {\n var id = data._idList[rawIndex];\n\n if (id == null && data._idDimIdx != null) {\n id = getIdNameFromStore(data, data._idDimIdx, rawIndex);\n }\n\n if (id == null) {\n id = ID_PREFIX + rawIndex;\n }\n\n return id;\n };\n\n normalizeDimensions = function (dimensions) {\n if (!zrUtil.isArray(dimensions)) {\n dimensions = dimensions != null ? [dimensions] : [];\n }\n\n return dimensions;\n };\n /**\n * Data in excludeDimensions is copied, otherwise transfered.\n */\n\n\n cloneListForMapAndSample = function (original) {\n var list = new SeriesData(original._schema ? original._schema : map(original.dimensions, original._getDimInfo, original), original.hostModel); // FIXME If needs stackedOn, value may already been stacked\n\n transferProperties(list, original);\n return list;\n };\n\n transferProperties = function (target, source) {\n zrUtil.each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) {\n if (source.hasOwnProperty(propName)) {\n target[propName] = source[propName];\n }\n });\n target.__wrappedMethods = source.__wrappedMethods;\n zrUtil.each(CLONE_PROPERTIES, function (propName) {\n target[propName] = zrUtil.clone(source[propName]);\n });\n target._calculationInfo = zrUtil.extend({}, source._calculationInfo);\n };\n\n makeIdFromName = function (data, idx) {\n var nameList = data._nameList;\n var idList = data._idList;\n var nameDimIdx = data._nameDimIdx;\n var idDimIdx = data._idDimIdx;\n var name = nameList[idx];\n var id = idList[idx];\n\n if (name == null && nameDimIdx != null) {\n nameList[idx] = name = getIdNameFromStore(data, nameDimIdx, idx);\n }\n\n if (id == null && idDimIdx != null) {\n idList[idx] = id = getIdNameFromStore(data, idDimIdx, idx);\n }\n\n if (id == null && name != null) {\n var nameRepeatCount = data._nameRepeatCount;\n var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;\n id = name;\n\n if (nmCnt > 1) {\n id += '__ec__' + nmCnt;\n }\n\n idList[idx] = id;\n }\n };\n }();\n\n return SeriesData;\n}();\n\nexport default SeriesData;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport * as zrUtil from 'zrender/lib/core/util';\nvar availableMethods = ['getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL', // 'getModel',\n'getOption', // 'getViewOfComponentModel',\n// 'getViewOfSeriesModel',\n'getId', 'updateLabelLayout'];\n\nvar ExtensionAPI =\n/** @class */\nfunction () {\n function ExtensionAPI(ecInstance) {\n zrUtil.each(availableMethods, function (methodName) {\n this[methodName] = zrUtil.bind(ecInstance[methodName], ecInstance);\n }, this);\n }\n\n return ExtensionAPI;\n}();\n\nexport default ExtensionAPI;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { each, map, isFunction, createHashMap, noop, assert } from 'zrender/lib/core/util';\nimport { createTask } from './task';\nimport { getUID } from '../util/component';\nimport GlobalModel from '../model/Global';\nimport ExtensionAPI from './ExtensionAPI';\nimport { normalizeToArray } from '../util/model';\n;\n\nvar Scheduler =\n/** @class */\nfunction () {\n function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) {\n // key: handlerUID\n this._stageTaskMap = createHashMap();\n this.ecInstance = ecInstance;\n this.api = api; // Fix current processors in case that in some rear cases that\n // processors might be registered after echarts instance created.\n // Register processors incrementally for a echarts instance is\n // not supported by this stream architecture.\n\n dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();\n visualHandlers = this._visualHandlers = visualHandlers.slice();\n this._allHandlers = dataProcessorHandlers.concat(visualHandlers);\n }\n\n Scheduler.prototype.restoreData = function (ecModel, payload) {\n // TODO: Only restore needed series and components, but not all components.\n // Currently `restoreData` of all of the series and component will be called.\n // But some independent components like `title`, `legend`, `graphic`, `toolbox`,\n // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`,\n // and some components like coordinate system, axes, dataZoom, visualMap only\n // need their target series refresh.\n // (1) If we are implementing this feature some day, we should consider these cases:\n // if a data processor depends on a component (e.g., dataZoomProcessor depends\n // on the settings of `dataZoom`), it should be re-performed if the component\n // is modified by `setOption`.\n // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`,\n // it should be re-performed when the result array of `getTargetSeries` changed.\n // We use `dependencies` to cover these issues.\n // (3) How to update target series when coordinate system related components modified.\n // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty,\n // and this case all of the tasks will be set as dirty.\n ecModel.restoreData(payload); // Theoretically an overall task not only depends on each of its target series, but also\n // depends on all of the series.\n // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks\n // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure\n // that the overall task is set as dirty and to be performed, otherwise it probably cause\n // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it\n // probably cause state chaos (consider `dataZoomProcessor`).\n\n this._stageTaskMap.each(function (taskRecord) {\n var overallTask = taskRecord.overallTask;\n overallTask && overallTask.dirty();\n });\n }; // If seriesModel provided, incremental threshold is check by series data.\n\n\n Scheduler.prototype.getPerformArgs = function (task, isBlock) {\n // For overall task\n if (!task.__pipeline) {\n return;\n }\n\n var pipeline = this._pipelineMap.get(task.__pipeline.id);\n\n var pCtx = pipeline.context;\n var incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex;\n var step = incremental ? pipeline.step : null;\n var modDataCount = pCtx && pCtx.modDataCount;\n var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;\n return {\n step: step,\n modBy: modBy,\n modDataCount: modDataCount\n };\n };\n\n Scheduler.prototype.getPipeline = function (pipelineId) {\n return this._pipelineMap.get(pipelineId);\n };\n /**\n * Current, progressive rendering starts from visual and layout.\n * Always detect render mode in the same stage, avoiding that incorrect\n * detection caused by data filtering.\n * Caution:\n * `updateStreamModes` use `seriesModel.getData()`.\n */\n\n\n Scheduler.prototype.updateStreamModes = function (seriesModel, view) {\n var pipeline = this._pipelineMap.get(seriesModel.uid);\n\n var data = seriesModel.getData();\n var dataLen = data.count(); // `progressiveRender` means that can render progressively in each\n // animation frame. Note that some types of series do not provide\n // `view.incrementalPrepareRender` but support `chart.appendData`. We\n // use the term `incremental` but not `progressive` to describe the\n // case that `chart.appendData`.\n\n var progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold;\n var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold'); // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint.\n // see `test/candlestick-large3.html`\n\n var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null;\n seriesModel.pipelineContext = pipeline.context = {\n progressiveRender: progressiveRender,\n modDataCount: modDataCount,\n large: large\n };\n };\n\n Scheduler.prototype.restorePipelines = function (ecModel) {\n var scheduler = this;\n var pipelineMap = scheduler._pipelineMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var progressive = seriesModel.getProgressive();\n var pipelineId = seriesModel.uid;\n pipelineMap.set(pipelineId, {\n id: pipelineId,\n head: null,\n tail: null,\n threshold: seriesModel.getProgressiveThreshold(),\n progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),\n blockIndex: -1,\n step: Math.round(progressive || 700),\n count: 0\n });\n\n scheduler._pipe(seriesModel, seriesModel.dataTask);\n });\n };\n\n Scheduler.prototype.prepareStageTasks = function () {\n var stageTaskMap = this._stageTaskMap;\n var ecModel = this.api.getModel();\n var api = this.api;\n each(this._allHandlers, function (handler) {\n var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n // Currently do not need to support to sepecify them both.\n errMsg = '\"reset\" and \"overallReset\" must not be both specified.';\n }\n\n assert(!(handler.reset && handler.overallReset), errMsg);\n handler.reset && this._createSeriesStageTask(handler, record, ecModel, api);\n handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api);\n }, this);\n };\n\n Scheduler.prototype.prepareView = function (view, model, ecModel, api) {\n var renderTask = view.renderTask;\n var context = renderTask.context;\n context.model = model;\n context.ecModel = ecModel;\n context.api = api;\n renderTask.__block = !view.incrementalPrepareRender;\n\n this._pipe(model, renderTask);\n };\n\n Scheduler.prototype.performDataProcessorTasks = function (ecModel, payload) {\n // If we do not use `block` here, it should be considered when to update modes.\n this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, {\n block: true\n });\n };\n\n Scheduler.prototype.performVisualTasks = function (ecModel, payload, opt) {\n this._performStageTasks(this._visualHandlers, ecModel, payload, opt);\n };\n\n Scheduler.prototype._performStageTasks = function (stageHandlers, ecModel, payload, opt) {\n opt = opt || {};\n var unfinished = false;\n var scheduler = this;\n each(stageHandlers, function (stageHandler, idx) {\n if (opt.visualType && opt.visualType !== stageHandler.visualType) {\n return;\n }\n\n var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);\n\n var seriesTaskMap = stageHandlerRecord.seriesTaskMap;\n var overallTask = stageHandlerRecord.overallTask;\n\n if (overallTask) {\n var overallNeedDirty_1;\n var agentStubMap = overallTask.agentStubMap;\n agentStubMap.each(function (stub) {\n if (needSetDirty(opt, stub)) {\n stub.dirty();\n overallNeedDirty_1 = true;\n }\n });\n overallNeedDirty_1 && overallTask.dirty();\n scheduler.updatePayload(overallTask, payload);\n var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block); // Execute stubs firstly, which may set the overall task dirty,\n // then execute the overall task. And stub will call seriesModel.setData,\n // which ensures that in the overallTask seriesModel.getData() will not\n // return incorrect data.\n\n agentStubMap.each(function (stub) {\n stub.perform(performArgs_1);\n });\n\n if (overallTask.perform(performArgs_1)) {\n unfinished = true;\n }\n } else if (seriesTaskMap) {\n seriesTaskMap.each(function (task, pipelineId) {\n if (needSetDirty(opt, task)) {\n task.dirty();\n }\n\n var performArgs = scheduler.getPerformArgs(task, opt.block); // FIXME\n // if intending to decalare `performRawSeries` in handlers, only\n // stream-independent (specifically, data item independent) operations can be\n // performed. Because is a series is filtered, most of the tasks will not\n // be performed. A stream-dependent operation probably cause wrong biz logic.\n // Perhaps we should not provide a separate callback for this case instead\n // of providing the config `performRawSeries`. The stream-dependent operaions\n // and stream-independent operations should better not be mixed.\n\n performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model);\n scheduler.updatePayload(task, payload);\n\n if (task.perform(performArgs)) {\n unfinished = true;\n }\n });\n }\n });\n\n function needSetDirty(opt, task) {\n return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id));\n }\n\n this.unfinished = unfinished || this.unfinished;\n };\n\n Scheduler.prototype.performSeriesTasks = function (ecModel) {\n var unfinished;\n ecModel.eachSeries(function (seriesModel) {\n // Progress to the end for dataInit and dataRestore.\n unfinished = seriesModel.dataTask.perform() || unfinished;\n });\n this.unfinished = unfinished || this.unfinished;\n };\n\n Scheduler.prototype.plan = function () {\n // Travel pipelines, check block.\n this._pipelineMap.each(function (pipeline) {\n var task = pipeline.tail;\n\n do {\n if (task.__block) {\n pipeline.blockIndex = task.__idxInPipeline;\n break;\n }\n\n task = task.getUpstream();\n } while (task);\n });\n };\n\n Scheduler.prototype.updatePayload = function (task, payload) {\n payload !== 'remain' && (task.context.payload = payload);\n };\n\n Scheduler.prototype._createSeriesStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\n var scheduler = this;\n var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap; // The count of stages are totally about only several dozen, so\n // do not need to reuse the map.\n\n var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();\n var seriesType = stageHandler.seriesType;\n var getTargetSeries = stageHandler.getTargetSeries; // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily,\n // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`,\n // it works but it may cause other irrelevant charts blocked.\n\n if (stageHandler.createOnAllSeries) {\n ecModel.eachRawSeries(create);\n } else if (seriesType) {\n ecModel.eachRawSeriesByType(seriesType, create);\n } else if (getTargetSeries) {\n getTargetSeries(ecModel, api).each(create);\n }\n\n function create(seriesModel) {\n var pipelineId = seriesModel.uid; // Init tasks for each seriesModel only once.\n // Reuse original task instance.\n\n var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId) || createTask({\n plan: seriesTaskPlan,\n reset: seriesTaskReset,\n count: seriesTaskCount\n }));\n task.context = {\n model: seriesModel,\n ecModel: ecModel,\n api: api,\n // PENDING: `useClearVisual` not used?\n useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,\n plan: stageHandler.plan,\n reset: stageHandler.reset,\n scheduler: scheduler\n };\n\n scheduler._pipe(seriesModel, task);\n }\n };\n\n Scheduler.prototype._createOverallStageTask = function (stageHandler, stageHandlerRecord, ecModel, api) {\n var scheduler = this;\n var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask // For overall task, the function only be called on reset stage.\n || createTask({\n reset: overallTaskReset\n });\n overallTask.context = {\n ecModel: ecModel,\n api: api,\n overallReset: stageHandler.overallReset,\n scheduler: scheduler\n };\n var oldAgentStubMap = overallTask.agentStubMap; // The count of stages are totally about only several dozen, so\n // do not need to reuse the map.\n\n var newAgentStubMap = overallTask.agentStubMap = createHashMap();\n var seriesType = stageHandler.seriesType;\n var getTargetSeries = stageHandler.getTargetSeries;\n var overallProgress = true;\n var shouldOverallTaskDirty = false; // FIXME:TS never used, so comment it\n // let modifyOutputEnd = stageHandler.modifyOutputEnd;\n // An overall task with seriesType detected or has `getTargetSeries`, we add\n // stub in each pipelines, it will set the overall task dirty when the pipeline\n // progress. Moreover, to avoid call the overall task each frame (too frequent),\n // we set the pipeline block.\n\n var errMsg = '';\n\n if (process.env.NODE_ENV !== 'production') {\n errMsg = '\"createOnAllSeries\" do not supported for \"overallReset\", ' + 'becuase it will block all streams.';\n }\n\n assert(!stageHandler.createOnAllSeries, errMsg);\n\n if (seriesType) {\n ecModel.eachRawSeriesByType(seriesType, createStub);\n } else if (getTargetSeries) {\n getTargetSeries(ecModel, api).each(createStub);\n } // Otherwise, (usually it is legancy case), the overall task will only be\n // executed when upstream dirty. Otherwise the progressive rendering of all\n // pipelines will be disabled unexpectedly. But it still needs stubs to receive\n // dirty info from upsteam.\n else {\n overallProgress = false;\n each(ecModel.getSeries(), createStub);\n }\n\n function createStub(seriesModel) {\n var pipelineId = seriesModel.uid;\n var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId) || ( // When the result of `getTargetSeries` changed, the overallTask\n // should be set as dirty and re-performed.\n shouldOverallTaskDirty = true, createTask({\n reset: stubReset,\n onDirty: stubOnDirty\n })));\n stub.context = {\n model: seriesModel,\n overallProgress: overallProgress // FIXME:TS never used, so comment it\n // modifyOutputEnd: modifyOutputEnd\n\n };\n stub.agent = overallTask;\n stub.__block = overallProgress;\n\n scheduler._pipe(seriesModel, stub);\n }\n\n if (shouldOverallTaskDirty) {\n overallTask.dirty();\n }\n };\n\n Scheduler.prototype._pipe = function (seriesModel, task) {\n var pipelineId = seriesModel.uid;\n\n var pipeline = this._pipelineMap.get(pipelineId);\n\n !pipeline.head && (pipeline.head = task);\n pipeline.tail && pipeline.tail.pipe(task);\n pipeline.tail = task;\n task.__idxInPipeline = pipeline.count++;\n task.__pipeline = pipeline;\n };\n\n Scheduler.wrapStageHandler = function (stageHandler, visualType) {\n if (isFunction(stageHandler)) {\n stageHandler = {\n overallReset: stageHandler,\n seriesType: detectSeriseType(stageHandler)\n };\n }\n\n stageHandler.uid = getUID('stageHandler');\n visualType && (stageHandler.visualType = visualType);\n return stageHandler;\n };\n\n ;\n return Scheduler;\n}();\n\nfunction overallTaskReset(context) {\n context.overallReset(context.ecModel, context.api, context.payload);\n}\n\nfunction stubReset(context) {\n return context.overallProgress && stubProgress;\n}\n\nfunction stubProgress() {\n this.agent.dirty();\n this.getDownstream().dirty();\n}\n\nfunction stubOnDirty() {\n this.agent && this.agent.dirty();\n}\n\nfunction seriesTaskPlan(context) {\n return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;\n}\n\nfunction seriesTaskReset(context) {\n if (context.useClearVisual) {\n context.data.clearAllVisual();\n }\n\n var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));\n return resetDefines.length > 1 ? map(resetDefines, function (v, idx) {\n return makeSeriesTaskProgress(idx);\n }) : singleSeriesTaskProgress;\n}\n\nvar singleSeriesTaskProgress = makeSeriesTaskProgress(0);\n\nfunction makeSeriesTaskProgress(resetDefineIdx) {\n return function (params, context) {\n var data = context.data;\n var resetDefine = context.resetDefines[resetDefineIdx];\n\n if (resetDefine && resetDefine.dataEach) {\n for (var i = params.start; i < params.end; i++) {\n resetDefine.dataEach(data, i);\n }\n } else if (resetDefine && resetDefine.progress) {\n resetDefine.progress(params, data);\n }\n };\n}\n\nfunction seriesTaskCount(context) {\n return context.data.count();\n}\n/**\n * Only some legacy stage handlers (usually in echarts extensions) are pure function.\n * To ensure that they can work normally, they should work in block mode, that is,\n * they should not be started util the previous tasks finished. So they cause the\n * progressive rendering disabled. We try to detect the series type, to narrow down\n * the block range to only the series type they concern, but not all series.\n */\n\n\nfunction detectSeriseType(legacyFunc) {\n seriesType = null;\n\n try {\n // Assume there is no async when calling `eachSeriesByType`.\n legacyFunc(ecModelMock, apiMock);\n } catch (e) {}\n\n return seriesType;\n}\n\nvar ecModelMock = {};\nvar apiMock = {};\nvar seriesType;\nmockMethods(ecModelMock, GlobalModel);\nmockMethods(apiMock, ExtensionAPI);\n\necModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) {\n seriesType = type;\n};\n\necModelMock.eachComponent = function (cond) {\n if (cond.mainType === 'series' && cond.subType) {\n seriesType = cond.subType;\n }\n};\n\nfunction mockMethods(target, Clz) {\n /* eslint-disable */\n for (var name_1 in Clz.prototype) {\n // Do not use hasOwnProperty\n target[name_1] = noop;\n }\n /* eslint-enable */\n\n}\n\nexport default Scheduler;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport Eventful from 'zrender/lib/core/Eventful';\n;\nvar lifecycle = new Eventful();\nexport default lifecycle;","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\nimport { __extends } from \"tslib\";\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nimport * as zrender from 'zrender/lib/zrender';\nimport { assert, each, isFunction, isObject, indexOf, bind, clone, setAsPrimitive, createCanvas, extend, createHashMap, map, defaults, isDom, isArray, $override, noop } from 'zrender/lib/core/util';\nimport * as colorTool from 'zrender/lib/tool/color';\nimport env from 'zrender/lib/core/env';\nimport timsort from 'zrender/lib/core/timsort';\nimport Eventful from 'zrender/lib/core/Eventful';\nimport GlobalModel from '../model/Global';\nimport ExtensionAPI from './ExtensionAPI';\nimport CoordinateSystemManager from './CoordinateSystem';\nimport OptionManager from '../model/OptionManager';\nimport backwardCompat from '../preprocessor/backwardCompat';\nimport dataStack from '../processor/dataStack';\nimport SeriesModel from '../model/Series';\nimport ComponentView from '../view/Component';\nimport ChartView from '../view/Chart';\nimport * as graphic from '../util/graphic';\nimport { getECData } from '../util/innerStore';\nimport { isHighDownDispatcher, HOVER_STATE_EMPHASIS, HOVER_STATE_BLUR, blurSeriesFromHighlightPayload, toggleSelectionFromPayload, updateSeriesElementSelection, getAllSelectedIndices, isSelectChangePayload, isHighDownPayload, HIGHLIGHT_ACTION_TYPE, DOWNPLAY_ACTION_TYPE, SELECT_ACTION_TYPE, UNSELECT_ACTION_TYPE, TOGGLE_SELECT_ACTION_TYPE, savePathStates, enterEmphasis, leaveEmphasis, leaveBlur, enterSelect, leaveSelect, enterBlur, allLeaveBlur, findComponentHighDownDispatchers, blurComponent, handleGlobalMouseOverForHighDown, handleGlboalMouseOutForHighDown } from '../util/states';\nimport * as modelUtil from '../util/model';\nimport { throttle } from '../util/throttle';\nimport { seriesStyleTask, dataStyleTask, dataColorPaletteTask } from '../visual/style';\nimport loadingDefault from '../loading/default';\nimport Scheduler from './Scheduler';\nimport lightTheme from '../theme/light';\nimport darkTheme from '../theme/dark';\nimport { parseClassType } from '../util/clazz';\nimport { ECEventProcessor } from '../util/ECEventProcessor';\nimport { seriesSymbolTask, dataSymbolTask } from '../visual/symbol';\nimport { getVisualFromData, getItemVisualFromData } from '../visual/helper';\nimport { deprecateLog } from '../util/log';\nimport { handleLegacySelectEvents } from '../legacy/dataSelectAction';\nimport { registerExternalTransform } from '../data/helper/transform';\nimport { createLocaleObject, SYSTEM_LANG } from './locale';\nimport { findEventDispatcher } from '../util/event';\nimport decal from '../visual/decal';\nimport geoSourceManager from '../coord/geo/geoSourceManager';\nimport lifecycle from './lifecycle';\nvar hasWindow = typeof window !== 'undefined';\nexport var version = '5.2.0';\nexport var dependencies = {\n zrender: '5.2.0'\n};\nvar TEST_FRAME_REMAIN_TIME = 1;\nvar PRIORITY_PROCESSOR_SERIES_FILTER = 800; // Some data processors depends on the stack result dimension (to calculate data extent).\n// So data stack stage should be in front of data processing stage.\n\nvar PRIORITY_PROCESSOR_DATASTACK = 900; // \"Data filter\" will block the stream, so it should be\n// put at the begining of data processing.\n\nvar PRIORITY_PROCESSOR_FILTER = 1000;\nvar PRIORITY_PROCESSOR_DEFAULT = 2000;\nvar PRIORITY_PROCESSOR_STATISTIC = 5000;\nvar PRIORITY_VISUAL_LAYOUT = 1000;\nvar PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;\nvar PRIORITY_VISUAL_GLOBAL = 2000;\nvar PRIORITY_VISUAL_CHART = 3000;\nvar PRIORITY_VISUAL_COMPONENT = 4000; // Visual property in data. Greater than `PRIORITY_VISUAL_COMPONENT` to enable to\n// overwrite the viusal result of component (like `visualMap`)\n// using data item specific setting (like itemStyle.xxx on data item)\n\nvar PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500; // Greater than `PRIORITY_VISUAL_CHART_DATA_CUSTOM` to enable to layout based on\n// visual result like `symbolSize`.\n\nvar PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;\nvar PRIORITY_VISUAL_BRUSH = 5000;\nvar PRIORITY_VISUAL_ARIA = 6000;\nvar PRIORITY_VISUAL_DECAL = 7000;\nexport var PRIORITY = {\n PROCESSOR: {\n FILTER: PRIORITY_PROCESSOR_FILTER,\n SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,\n STATISTIC: PRIORITY_PROCESSOR_STATISTIC\n },\n VISUAL: {\n LAYOUT: PRIORITY_VISUAL_LAYOUT,\n PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,\n GLOBAL: PRIORITY_VISUAL_GLOBAL,\n CHART: PRIORITY_VISUAL_CHART,\n POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,\n COMPONENT: PRIORITY_VISUAL_COMPONENT,\n BRUSH: PRIORITY_VISUAL_BRUSH,\n CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,\n ARIA: PRIORITY_VISUAL_ARIA,\n DECAL: PRIORITY_VISUAL_DECAL\n }\n}; // Main process have three entries: `setOption`, `dispatchAction` and `resize`,\n// where they must not be invoked nestedly, except the only case: invoke\n// dispatchAction with updateMethod \"none\" in main process.\n// This flag is used to carry out this rule.\n// All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]).\n\nvar IN_MAIN_PROCESS_KEY = '__flagInMainProcess';\nvar PENDING_UPDATE = '__pendingUpdate';\nvar STATUS_NEEDS_UPDATE_KEY = '__needsUpdateStatus';\nvar ACTION_REG = /^[a-zA-Z0-9_]+$/;\nvar CONNECT_STATUS_KEY = '__connectUpdateStatus';\nvar CONNECT_STATUS_PENDING = 0;\nvar CONNECT_STATUS_UPDATING = 1;\nvar CONNECT_STATUS_UPDATED = 2;\n;\n;\n\nfunction createRegisterEventWithLowercaseECharts(method) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n if (this.isDisposed()) {\n disposedWarning(this.id);\n return;\n }\n\n return toLowercaseNameAndCallEventful(this, method, args);\n };\n}\n\nfunction createRegisterEventWithLowercaseMessageCenter(method) {\n return function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n return toLowercaseNameAndCallEventful(this, method, args);\n };\n}\n\nfunction toLowercaseNameAndCallEventful(host, method, args) {\n // `args[0]` is event name. Event name is all lowercase.\n args[0] = args[0] && args[0].toLowerCase();\n return Eventful.prototype[method].apply(host, args);\n}\n\nvar MessageCenter =\n/** @class */\nfunction (_super) {\n __extends(MessageCenter, _super);\n\n function MessageCenter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n return MessageCenter;\n}(Eventful);\n\nvar messageCenterProto = MessageCenter.prototype;\nmessageCenterProto.on = createRegisterEventWithLowercaseMessageCenter('on');\nmessageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off'); // ---------------------------------------\n// Internal method names for class ECharts\n// ---------------------------------------\n\nvar prepare;\nvar prepareView;\nvar updateDirectly;\nvar updateMethods;\nvar doConvertPixel;\nvar updateStreamModes;\nvar doDispatchAction;\nvar flushPendingActions;\nvar triggerUpdatedEvent;\nvar bindRenderedEvent;\nvar bindMouseEvent;\nvar clearColorPalette;\nvar render;\nvar renderComponents;\nvar renderSeries;\nvar createExtensionAPI;\nvar enableConnect;\nvar markStatusToUpdate;\nvar applyChangedStates;\n\nvar ECharts =\n/** @class */\nfunction (_super) {\n __extends(ECharts, _super);\n\n function ECharts(dom, // Theme name or themeOption.\n theme, opts) {\n var _this = _super.call(this, new ECEventProcessor()) || this;\n\n _this._chartsViews = [];\n _this._chartsMap = {};\n _this._componentsViews = [];\n _this._componentsMap = {}; // Can't dispatch action during rendering procedure\n\n _this._pendingActions = [];\n opts = opts || {}; // Get theme by name\n\n if (typeof theme === 'string') {\n theme = themeStorage[theme];\n }\n\n _this._dom = dom;\n var defaultRenderer = 'canvas';\n var defaultUseDirtyRect = false;\n\n if (process.env.NODE_ENV !== 'production') {\n var root =\n /* eslint-disable-next-line */\n hasWindow ? window : global;\n defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;\n var devUseDirtyRect = root.__ECHARTS__DEFAULT__USE_DIRTY_RECT__;\n defaultUseDirtyRect = devUseDirtyRect == null ? defaultUseDirtyRect : devUseDirtyRect;\n }\n\n var zr = _this._zr = zrender.init(dom, {\n renderer: opts.renderer || defaultRenderer,\n devicePixelRatio: opts.devicePixelRatio,\n width: opts.width,\n height: opts.height,\n useDirtyRect: opts.useDirtyRect == null ? defaultUseDirtyRect : opts.useDirtyRect\n }); // Expect 60 fps.\n\n _this._throttledZrFlush = throttle(bind(zr.flush, zr), 17);\n theme = clone(theme);\n theme && backwardCompat(theme, true);\n _this._theme = theme;\n _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);\n _this._coordSysMgr = new CoordinateSystemManager();\n var api = _this._api = createExtensionAPI(_this); // Sort on demand\n\n function prioritySortFunc(a, b) {\n return a.__prio - b.__prio;\n }\n\n timsort(visualFuncs, prioritySortFunc);\n timsort(dataProcessorFuncs, prioritySortFunc);\n _this._scheduler = new Scheduler(_this, api, dataProcessorFuncs, visualFuncs);\n _this._messageCenter = new MessageCenter(); // Init mouse events\n\n _this._initEvents(); // In case some people write `window.onresize = chart.resize`\n\n\n _this.resize = bind(_this.resize, _this);\n zr.animation.on('frame', _this._onframe, _this);\n bindRenderedEvent(zr, _this);\n bindMouseEvent(zr, _this); // ECharts instance can be used as value.\n\n setAsPrimitive(_this);\n return _this;\n }\n\n ECharts.prototype._onframe = function () {\n if (this._disposed) {\n return;\n }\n\n applyChangedStates(this);\n var scheduler = this._scheduler; // Lazy update\n\n if (this[PENDING_UPDATE]) {\n var silent = this[PENDING_UPDATE].silent;\n this[IN_MAIN_PROCESS_KEY] = true;\n prepare(this);\n updateMethods.update.call(this, null, this[PENDING_UPDATE].updateParams); // At present, in each frame, zrender performs:\n // (1) animation step forward.\n // (2) trigger('frame') (where this `_onframe` is called)\n // (3) zrender flush (render).\n // If we do nothing here, since we use `setToFinal: true`, the step (3) above\n // will render the final state of the elements before the real animation started.\n\n this._zr.flush();\n\n this[IN_MAIN_PROCESS_KEY] = false;\n this[PENDING_UPDATE] = null;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n } // Avoid do both lazy update and progress in one frame.\n else if (scheduler.unfinished) {\n // Stream progress.\n var remainTime = TEST_FRAME_REMAIN_TIME;\n var ecModel = this._model;\n var api = this._api;\n scheduler.unfinished = false;\n\n do {\n var startTime = +new Date();\n scheduler.performSeriesTasks(ecModel); // Currently dataProcessorFuncs do not check threshold.\n\n scheduler.performDataProcessorTasks(ecModel);\n updateStreamModes(this, ecModel); // Do not update coordinate system here. Because that coord system update in\n // each frame is not a good user experience. So we follow the rule that\n // the extent of the coordinate system is determin in the first frame (the\n // frame is executed immedietely after task reset.\n // this._coordSysMgr.update(ecModel, api);\n // console.log('--- ec frame visual ---', remainTime);\n\n scheduler.performVisualTasks(ecModel);\n renderSeries(this, this._model, api, 'remain', {});\n remainTime -= +new Date() - startTime;\n } while (remainTime > 0 && scheduler.unfinished); // Call flush explicitly for trigger finished event.\n\n\n if (!scheduler.unfinished) {\n this._zr.flush();\n } // Else, zr flushing be ensue within the same frame,\n // because zr flushing is after onframe event.\n\n }\n };\n\n ECharts.prototype.getDom = function () {\n return this._dom;\n };\n\n ECharts.prototype.getId = function () {\n return this.id;\n };\n\n ECharts.prototype.getZr = function () {\n return this._zr;\n };\n /* eslint-disable-next-line */\n\n\n ECharts.prototype.setOption = function (option, notMerge, lazyUpdate) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this[IN_MAIN_PROCESS_KEY], '`setOption` should not be called during main process.');\n }\n\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var silent;\n var replaceMerge;\n var transitionOpt;\n\n if (isObject(notMerge)) {\n lazyUpdate = notMerge.lazyUpdate;\n silent = notMerge.silent;\n replaceMerge = notMerge.replaceMerge;\n transitionOpt = notMerge.transition;\n notMerge = notMerge.notMerge;\n }\n\n this[IN_MAIN_PROCESS_KEY] = true;\n\n if (!this._model || notMerge) {\n var optionManager = new OptionManager(this._api);\n var theme = this._theme;\n var ecModel = this._model = new GlobalModel();\n ecModel.scheduler = this._scheduler;\n ecModel.init(null, null, null, theme, this._locale, optionManager);\n }\n\n this._model.setOption(option, {\n replaceMerge: replaceMerge\n }, optionPreprocessorFuncs);\n\n var updateParams = {\n seriesTransition: transitionOpt,\n optionChanged: true\n };\n\n if (lazyUpdate) {\n this[PENDING_UPDATE] = {\n silent: silent,\n updateParams: updateParams\n };\n this[IN_MAIN_PROCESS_KEY] = false; // `setOption(option, {lazyMode: true})` may be called when zrender has been slept.\n // It should wake it up to make sure zrender start to render at the next frame.\n\n this.getZr().wakeUp();\n } else {\n prepare(this);\n updateMethods.update.call(this, null, updateParams); // Ensure zr refresh sychronously, and then pixel in canvas can be\n // fetched after `setOption`.\n\n this._zr.flush();\n\n this[PENDING_UPDATE] = null;\n this[IN_MAIN_PROCESS_KEY] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n }\n };\n /**\n * @DEPRECATED\n */\n\n\n ECharts.prototype.setTheme = function () {\n console.error('ECharts#setTheme() is DEPRECATED in ECharts 3.0');\n }; // We don't want developers to use getModel directly.\n\n\n ECharts.prototype.getModel = function () {\n return this._model;\n };\n\n ECharts.prototype.getOption = function () {\n return this._model && this._model.getOption();\n };\n\n ECharts.prototype.getWidth = function () {\n return this._zr.getWidth();\n };\n\n ECharts.prototype.getHeight = function () {\n return this._zr.getHeight();\n };\n\n ECharts.prototype.getDevicePixelRatio = function () {\n return this._zr.painter.dpr\n /* eslint-disable-next-line */\n || hasWindow && window.devicePixelRatio || 1;\n };\n /**\n * Get canvas which has all thing rendered\n */\n\n\n ECharts.prototype.getRenderedCanvas = function (opts) {\n if (!env.canvasSupported) {\n return;\n }\n\n opts = opts || {};\n return this._zr.painter.getRenderedCanvas({\n backgroundColor: opts.backgroundColor || this._model.get('backgroundColor'),\n pixelRatio: opts.pixelRatio || this.getDevicePixelRatio()\n });\n };\n /**\n * Get svg data url\n */\n\n\n ECharts.prototype.getSvgDataURL = function () {\n if (!env.svgSupported) {\n return;\n }\n\n var zr = this._zr;\n var list = zr.storage.getDisplayList(); // Stop animations\n\n each(list, function (el) {\n el.stopAnimation(null, true);\n });\n return zr.painter.toDataURL();\n };\n\n ECharts.prototype.getDataURL = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n opts = opts || {};\n var excludeComponents = opts.excludeComponents;\n var ecModel = this._model;\n var excludesComponentViews = [];\n var self = this;\n each(excludeComponents, function (componentType) {\n ecModel.eachComponent({\n mainType: componentType\n }, function (component) {\n var view = self._componentsMap[component.__viewId];\n\n if (!view.group.ignore) {\n excludesComponentViews.push(view);\n view.group.ignore = true;\n }\n });\n });\n var url = this._zr.painter.getType() === 'svg' ? this.getSvgDataURL() : this.getRenderedCanvas(opts).toDataURL('image/' + (opts && opts.type || 'png'));\n each(excludesComponentViews, function (view) {\n view.group.ignore = false;\n });\n return url;\n };\n\n ECharts.prototype.getConnectedDataURL = function (opts) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (!env.canvasSupported) {\n return;\n }\n\n var isSvg = opts.type === 'svg';\n var groupId = this.group;\n var mathMin = Math.min;\n var mathMax = Math.max;\n var MAX_NUMBER = Infinity;\n\n if (connectedGroups[groupId]) {\n var left_1 = MAX_NUMBER;\n var top_1 = MAX_NUMBER;\n var right_1 = -MAX_NUMBER;\n var bottom_1 = -MAX_NUMBER;\n var canvasList_1 = [];\n var dpr_1 = opts && opts.pixelRatio || this.getDevicePixelRatio();\n each(instances, function (chart, id) {\n if (chart.group === groupId) {\n var canvas = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.getRenderedCanvas(clone(opts));\n var boundingRect = chart.getDom().getBoundingClientRect();\n left_1 = mathMin(boundingRect.left, left_1);\n top_1 = mathMin(boundingRect.top, top_1);\n right_1 = mathMax(boundingRect.right, right_1);\n bottom_1 = mathMax(boundingRect.bottom, bottom_1);\n canvasList_1.push({\n dom: canvas,\n left: boundingRect.left,\n top: boundingRect.top\n });\n }\n });\n left_1 *= dpr_1;\n top_1 *= dpr_1;\n right_1 *= dpr_1;\n bottom_1 *= dpr_1;\n var width = right_1 - left_1;\n var height = bottom_1 - top_1;\n var targetCanvas = createCanvas();\n var zr_1 = zrender.init(targetCanvas, {\n renderer: isSvg ? 'svg' : 'canvas'\n });\n zr_1.resize({\n width: width,\n height: height\n });\n\n if (isSvg) {\n var content_1 = '';\n each(canvasList_1, function (item) {\n var x = item.left - left_1;\n var y = item.top - top_1;\n content_1 += '' + item.dom + '';\n });\n zr_1.painter.getSvgRoot().innerHTML = content_1;\n\n if (opts.connectedBackgroundColor) {\n zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);\n }\n\n zr_1.refreshImmediately();\n return zr_1.painter.toDataURL();\n } else {\n // Background between the charts\n if (opts.connectedBackgroundColor) {\n zr_1.add(new graphic.Rect({\n shape: {\n x: 0,\n y: 0,\n width: width,\n height: height\n },\n style: {\n fill: opts.connectedBackgroundColor\n }\n }));\n }\n\n each(canvasList_1, function (item) {\n var img = new graphic.Image({\n style: {\n x: item.left * dpr_1 - left_1,\n y: item.top * dpr_1 - top_1,\n image: item.dom\n }\n });\n zr_1.add(img);\n });\n zr_1.refreshImmediately();\n return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));\n }\n } else {\n return this.getDataURL(opts);\n }\n };\n\n ECharts.prototype.convertToPixel = function (finder, value) {\n return doConvertPixel(this, 'convertToPixel', finder, value);\n };\n\n ECharts.prototype.convertFromPixel = function (finder, value) {\n return doConvertPixel(this, 'convertFromPixel', finder, value);\n };\n /**\n * Is the specified coordinate systems or components contain the given pixel point.\n * @param {Array|number} value\n * @return {boolean} result\n */\n\n\n ECharts.prototype.containPixel = function (finder, value) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var ecModel = this._model;\n var result;\n var findResult = modelUtil.parseFinder(ecModel, finder);\n each(findResult, function (models, key) {\n key.indexOf('Models') >= 0 && each(models, function (model) {\n var coordSys = model.coordinateSystem;\n\n if (coordSys && coordSys.containPoint) {\n result = result || !!coordSys.containPoint(value);\n } else if (key === 'seriesModels') {\n var view = this._chartsMap[model.__viewId];\n\n if (view && view.containPoint) {\n result = result || view.containPoint(value, model);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(key + ': ' + (view ? 'The found component do not support containPoint.' : 'No view mapping to the found component.'));\n }\n }\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(key + ': containPoint is not supported');\n }\n }\n }, this);\n }, this);\n return !!result;\n };\n /**\n * Get visual from series or data.\n * @param finder\n * If string, e.g., 'series', means {seriesIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex / seriesId / seriesName,\n * dataIndex / dataIndexInside\n * }\n * If dataIndex is not specified, series visual will be fetched,\n * but not data item visual.\n * If all of seriesIndex, seriesId, seriesName are not specified,\n * visual will be fetched from first series.\n * @param visualType 'color', 'symbol', 'symbolSize'\n */\n\n\n ECharts.prototype.getVisual = function (finder, visualType) {\n var ecModel = this._model;\n var parsedFinder = modelUtil.parseFinder(ecModel, finder, {\n defaultMainType: 'series'\n });\n var seriesModel = parsedFinder.seriesModel;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!seriesModel) {\n console.warn('There is no specified seires model');\n }\n }\n\n var data = seriesModel.getData();\n var dataIndexInside = parsedFinder.hasOwnProperty('dataIndexInside') ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty('dataIndex') ? data.indexOfRawIndex(parsedFinder.dataIndex) : null;\n return dataIndexInside != null ? getItemVisualFromData(data, dataIndexInside, visualType) : getVisualFromData(data, visualType);\n };\n /**\n * Get view of corresponding component model\n */\n\n\n ECharts.prototype.getViewOfComponentModel = function (componentModel) {\n return this._componentsMap[componentModel.__viewId];\n };\n /**\n * Get view of corresponding series model\n */\n\n\n ECharts.prototype.getViewOfSeriesModel = function (seriesModel) {\n return this._chartsMap[seriesModel.__viewId];\n };\n\n ECharts.prototype._initEvents = function () {\n var _this = this;\n\n each(MOUSE_EVENT_NAMES, function (eveName) {\n var handler = function (e) {\n var ecModel = _this.getModel();\n\n var el = e.target;\n var params;\n var isGlobalOut = eveName === 'globalout'; // no e.target when 'globalout'.\n\n if (isGlobalOut) {\n params = {};\n } else {\n el && findEventDispatcher(el, function (parent) {\n var ecData = getECData(parent);\n\n if (ecData && ecData.dataIndex != null) {\n var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);\n params = dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType) || {};\n return true;\n } // If element has custom eventData of components\n else if (ecData.eventData) {\n params = extend({}, ecData.eventData);\n return true;\n }\n }, true);\n } // Contract: if params prepared in mouse event,\n // these properties must be specified:\n // {\n // componentType: string (component main type)\n // componentIndex: number\n // }\n // Otherwise event query can not work.\n\n\n if (params) {\n var componentType = params.componentType;\n var componentIndex = params.componentIndex; // Special handling for historic reason: when trigger by\n // markLine/markPoint/markArea, the componentType is\n // 'markLine'/'markPoint'/'markArea', but we should better\n // enable them to be queried by seriesIndex, since their\n // option is set in each series.\n\n if (componentType === 'markLine' || componentType === 'markPoint' || componentType === 'markArea') {\n componentType = 'series';\n componentIndex = params.seriesIndex;\n }\n\n var model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex);\n var view = model && _this[model.mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId];\n\n if (process.env.NODE_ENV !== 'production') {\n // `event.componentType` and `event[componentTpype + 'Index']` must not\n // be missed, otherwise there is no way to distinguish source component.\n // See `dataFormat.getDataParams`.\n if (!isGlobalOut && !(model && view)) {\n console.warn('model or view can not be found by params');\n }\n }\n\n params.event = e;\n params.type = eveName;\n _this._$eventProcessor.eventInfo = {\n targetEl: el,\n packedEvent: params,\n model: model,\n view: view\n };\n\n _this.trigger(eveName, params);\n }\n }; // Consider that some component (like tooltip, brush, ...)\n // register zr event handler, but user event handler might\n // do anything, such as call `setOption` or `dispatchAction`,\n // which probably update any of the content and probably\n // cause problem if it is called previous other inner handlers.\n\n\n handler.zrEventfulCallAtLast = true;\n\n _this._zr.on(eveName, handler, _this);\n });\n each(eventActionMap, function (actionType, eventType) {\n _this._messageCenter.on(eventType, function (event) {\n this.trigger(eventType, event);\n }, _this);\n }); // Extra events\n // TODO register?\n\n each(['selectchanged'], function (eventType) {\n _this._messageCenter.on(eventType, function (event) {\n this.trigger(eventType, event);\n }, _this);\n });\n handleLegacySelectEvents(this._messageCenter, this, this._api);\n };\n\n ECharts.prototype.isDisposed = function () {\n return this._disposed;\n };\n\n ECharts.prototype.clear = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this.setOption({\n series: []\n }, true);\n };\n\n ECharts.prototype.dispose = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._disposed = true;\n modelUtil.setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, '');\n var chart = this;\n var api = chart._api;\n var ecModel = chart._model;\n each(chart._componentsViews, function (component) {\n component.dispose(ecModel, api);\n });\n each(chart._chartsViews, function (chart) {\n chart.dispose(ecModel, api);\n }); // Dispose after all views disposed\n\n chart._zr.dispose(); // Set properties to null.\n // To reduce the memory cost in case the top code still holds this instance unexpectedly.\n\n\n chart._dom = chart._model = chart._chartsMap = chart._componentsMap = chart._chartsViews = chart._componentsViews = chart._scheduler = chart._api = chart._zr = chart._throttledZrFlush = chart._theme = chart._coordSysMgr = chart._messageCenter = null;\n delete instances[chart.id];\n };\n /**\n * Resize the chart\n */\n\n\n ECharts.prototype.resize = function (opts) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!this[IN_MAIN_PROCESS_KEY], '`resize` should not be called during main process.');\n }\n\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._zr.resize(opts);\n\n var ecModel = this._model; // Resize loading effect\n\n this._loadingFX && this._loadingFX.resize();\n\n if (!ecModel) {\n return;\n }\n\n var needPrepare = ecModel.resetOption('media');\n var silent = opts && opts.silent; // There is some real cases that:\n // chart.setOption(option, { lazyUpdate: true });\n // chart.resize();\n\n if (this[PENDING_UPDATE]) {\n if (silent == null) {\n silent = this[PENDING_UPDATE].silent;\n }\n\n needPrepare = true;\n this[PENDING_UPDATE] = null;\n }\n\n this[IN_MAIN_PROCESS_KEY] = true;\n needPrepare && prepare(this);\n updateMethods.update.call(this, {\n type: 'resize',\n animation: extend({\n // Disable animation\n duration: 0\n }, opts && opts.animation)\n });\n this[IN_MAIN_PROCESS_KEY] = false;\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n };\n\n ECharts.prototype.showLoading = function (name, cfg) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (isObject(name)) {\n cfg = name;\n name = '';\n }\n\n name = name || 'default';\n this.hideLoading();\n\n if (!loadingEffects[name]) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Loading effects ' + name + ' not exists.');\n }\n\n return;\n }\n\n var el = loadingEffects[name](this._api, cfg);\n var zr = this._zr;\n this._loadingFX = el;\n zr.add(el);\n };\n /**\n * Hide loading effect\n */\n\n\n ECharts.prototype.hideLoading = function () {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n this._loadingFX && this._zr.remove(this._loadingFX);\n this._loadingFX = null;\n };\n\n ECharts.prototype.makeActionFromEvent = function (eventObj) {\n var payload = extend({}, eventObj);\n payload.type = eventActionMap[eventObj.type];\n return payload;\n };\n /**\n * @param opt If pass boolean, means opt.silent\n * @param opt.silent Default `false`. Whether trigger events.\n * @param opt.flush Default `undefined`.\n * true: Flush immediately, and then pixel in canvas can be fetched\n * immediately. Caution: it might affect performance.\n * false: Not flush.\n * undefined: Auto decide whether perform flush.\n */\n\n\n ECharts.prototype.dispatchAction = function (payload, opt) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n if (!isObject(opt)) {\n opt = {\n silent: !!opt\n };\n }\n\n if (!actions[payload.type]) {\n return;\n } // Avoid dispatch action before setOption. Especially in `connect`.\n\n\n if (!this._model) {\n return;\n } // May dispatchAction in rendering procedure\n\n\n if (this[IN_MAIN_PROCESS_KEY]) {\n this._pendingActions.push(payload);\n\n return;\n }\n\n var silent = opt.silent;\n doDispatchAction.call(this, payload, silent);\n var flush = opt.flush;\n\n if (flush) {\n this._zr.flush();\n } else if (flush !== false && env.browser.weChat) {\n // In WeChat embeded browser, `requestAnimationFrame` and `setInterval`\n // hang when sliding page (on touch event), which cause that zr does not\n // refresh util user interaction finished, which is not expected.\n // But `dispatchAction` may be called too frequently when pan on touch\n // screen, which impacts performance if do not throttle them.\n this._throttledZrFlush();\n }\n\n flushPendingActions.call(this, silent);\n triggerUpdatedEvent.call(this, silent);\n };\n\n ECharts.prototype.updateLabelLayout = function () {\n lifecycle.trigger('series:layoutlabels', this._model, this._api, {\n // Not adding series labels.\n // TODO\n updatedSeries: []\n });\n };\n\n ECharts.prototype.appendData = function (params) {\n if (this._disposed) {\n disposedWarning(this.id);\n return;\n }\n\n var seriesIndex = params.seriesIndex;\n var ecModel = this.getModel();\n var seriesModel = ecModel.getSeriesByIndex(seriesIndex);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(params.data && seriesModel);\n }\n\n seriesModel.appendData(params); // Note: `appendData` does not support that update extent of coordinate\n // system, util some scenario require that. In the expected usage of\n // `appendData`, the initial extent of coordinate system should better\n // be fixed by axis `min`/`max` setting or initial data, otherwise if\n // the extent changed while `appendData`, the location of the painted\n // graphic elements have to be changed, which make the usage of\n // `appendData` meaningless.\n\n this._scheduler.unfinished = true;\n this.getZr().wakeUp();\n }; // A work around for no `internal` modifier in ts yet but\n // need to strictly hide private methods to JS users.\n\n\n ECharts.internalField = function () {\n prepare = function (ecIns) {\n var scheduler = ecIns._scheduler;\n scheduler.restorePipelines(ecIns._model);\n scheduler.prepareStageTasks();\n prepareView(ecIns, true);\n prepareView(ecIns, false);\n scheduler.plan();\n };\n /**\n * Prepare view instances of charts and components\n */\n\n\n prepareView = function (ecIns, isComponent) {\n var ecModel = ecIns._model;\n var scheduler = ecIns._scheduler;\n var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;\n var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;\n var zr = ecIns._zr;\n var api = ecIns._api;\n\n for (var i = 0; i < viewList.length; i++) {\n viewList[i].__alive = false;\n }\n\n isComponent ? ecModel.eachComponent(function (componentType, model) {\n componentType !== 'series' && doPrepare(model);\n }) : ecModel.eachSeries(doPrepare);\n\n function doPrepare(model) {\n // By defaut view will be reused if possible for the case that `setOption` with \"notMerge\"\n // mode and need to enable transition animation. (Usually, when they have the same id, or\n // especially no id but have the same type & name & index. See the `model.id` generation\n // rule in `makeIdAndName` and `viewId` generation rule here).\n // But in `replaceMerge` mode, this feature should be able to disabled when it is clear that\n // the new model has nothing to do with the old model.\n var requireNewView = model.__requireNewView; // This command should not work twice.\n\n model.__requireNewView = false; // Consider: id same and type changed.\n\n var viewId = '_ec_' + model.id + '_' + model.type;\n var view = !requireNewView && viewMap[viewId];\n\n if (!view) {\n var classType = parseClassType(model.type);\n var Clazz = isComponent ? ComponentView.getClass(classType.main, classType.sub) : // FIXME:TS\n // (ChartView as ChartViewConstructor).getClass('series', classType.sub)\n // For backward compat, still support a chart type declared as only subType\n // like \"liquidfill\", but recommend \"series.liquidfill\"\n // But need a base class to make a type series.\n ChartView.getClass(classType.sub);\n\n if (process.env.NODE_ENV !== 'production') {\n assert(Clazz, classType.sub + ' does not exist.');\n }\n\n view = new Clazz();\n view.init(ecModel, api);\n viewMap[viewId] = view;\n viewList.push(view);\n zr.add(view.group);\n }\n\n model.__viewId = view.__id = viewId;\n view.__alive = true;\n view.__model = model;\n view.group.__ecComponentInfo = {\n mainType: model.mainType,\n index: model.componentIndex\n };\n !isComponent && scheduler.prepareView(view, model, ecModel, api);\n }\n\n for (var i = 0; i < viewList.length;) {\n var view = viewList[i];\n\n if (!view.__alive) {\n !isComponent && view.renderTask.dispose();\n zr.remove(view.group);\n view.dispose(ecModel, api);\n viewList.splice(i, 1);\n\n if (viewMap[view.__id] === view) {\n delete viewMap[view.__id];\n }\n\n view.__id = view.group.__ecComponentInfo = null;\n } else {\n i++;\n }\n }\n };\n\n updateDirectly = function (ecIns, method, payload, mainType, subType) {\n var ecModel = ecIns._model;\n ecModel.setUpdatePayload(payload); // broadcast\n\n if (!mainType) {\n // FIXME\n // Chart will not be update directly here, except set dirty.\n // But there is no such scenario now.\n each([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);\n return;\n }\n\n var query = {};\n query[mainType + 'Id'] = payload[mainType + 'Id'];\n query[mainType + 'Index'] = payload[mainType + 'Index'];\n query[mainType + 'Name'] = payload[mainType + 'Name'];\n var condition = {\n mainType: mainType,\n query: query\n };\n subType && (condition.subType = subType); // subType may be '' by parseClassType;\n\n var excludeSeriesId = payload.excludeSeriesId;\n var excludeSeriesIdMap;\n\n if (excludeSeriesId != null) {\n excludeSeriesIdMap = createHashMap();\n each(modelUtil.normalizeToArray(excludeSeriesId), function (id) {\n var modelId = modelUtil.convertOptionIdName(id, null);\n\n if (modelId != null) {\n excludeSeriesIdMap.set(modelId, true);\n }\n });\n }\n\n if (isHighDownPayload(payload)) {\n allLeaveBlur(ecIns._api);\n } // If dispatchAction before setOption, do nothing.\n\n\n ecModel && ecModel.eachComponent(condition, function (model) {\n var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) !== null;\n\n if (isExcluded) {\n return;\n }\n\n ;\n\n if (isHighDownPayload(payload)) {\n if (model instanceof SeriesModel) {\n if (payload.type === HIGHLIGHT_ACTION_TYPE && !payload.notBlur) {\n blurSeriesFromHighlightPayload(model, payload, ecIns._api);\n }\n } else {\n var _a = findComponentHighDownDispatchers(model.mainType, model.componentIndex, payload.name, ecIns._api),\n focusSelf = _a.focusSelf,\n dispatchers = _a.dispatchers;\n\n if (payload.type === HIGHLIGHT_ACTION_TYPE && focusSelf && !payload.notBlur) {\n blurComponent(model.mainType, model.componentIndex, ecIns._api);\n } // PENDING:\n // Whether to put this \"enter emphasis\" code in `ComponentView`,\n // which will be the same as `ChartView` but might be not necessary\n // and will be far from this logic.\n\n\n if (dispatchers) {\n each(dispatchers, function (dispatcher) {\n payload.type === HIGHLIGHT_ACTION_TYPE ? enterEmphasis(dispatcher) : leaveEmphasis(dispatcher);\n });\n }\n }\n } else if (isSelectChangePayload(payload)) {\n // TODO geo\n if (model instanceof SeriesModel) {\n toggleSelectionFromPayload(model, payload, ecIns._api);\n updateSeriesElementSelection(model);\n markStatusToUpdate(ecIns);\n }\n }\n }, ecIns);\n ecModel && ecModel.eachComponent(condition, function (model) {\n var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) !== null;\n\n if (isExcluded) {\n return;\n }\n\n ;\n callView(ecIns[mainType === 'series' ? '_chartsMap' : '_componentsMap'][model.__viewId]);\n }, ecIns);\n\n function callView(view) {\n view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);\n }\n };\n\n updateMethods = {\n prepareAndUpdate: function (payload) {\n prepare(this);\n updateMethods.update.call(this, payload, {\n // Needs to mark option changed if newOption is given.\n // It's from MagicType.\n // TODO If use a separate flag optionChanged in payload?\n optionChanged: payload.newOption != null\n });\n },\n update: function (payload, updateParams) {\n var ecModel = this._model;\n var api = this._api;\n var zr = this._zr;\n var coordSysMgr = this._coordSysMgr;\n var scheduler = this._scheduler; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload);\n scheduler.restoreData(ecModel, payload);\n scheduler.performSeriesTasks(ecModel); // TODO\n // Save total ecModel here for undo/redo (after restoring data and before processing data).\n // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.\n // Create new coordinate system each update\n // In LineView may save the old coordinate system and use it to get the orignal point\n\n coordSysMgr.create(ecModel, api);\n scheduler.performDataProcessorTasks(ecModel, payload); // Current stream render is not supported in data process. So we can update\n // stream modes after data processing, where the filtered data is used to\n // deteming whether use progressive rendering.\n\n updateStreamModes(this, ecModel); // We update stream modes before coordinate system updated, then the modes info\n // can be fetched when coord sys updating (consider the barGrid extent fix). But\n // the drawback is the full coord info can not be fetched. Fortunately this full\n // coord is not requied in stream mode updater currently.\n\n coordSysMgr.update(ecModel, api);\n clearColorPalette(ecModel);\n scheduler.performVisualTasks(ecModel, payload);\n render(this, ecModel, api, payload, updateParams); // Set background\n\n var backgroundColor = ecModel.get('backgroundColor') || 'transparent';\n var darkMode = ecModel.get('darkMode'); // In IE8\n\n if (!env.canvasSupported) {\n var colorArr = colorTool.parse(backgroundColor);\n backgroundColor = colorTool.stringify(colorArr, 'rgb');\n\n if (colorArr[3] === 0) {\n backgroundColor = 'transparent';\n }\n } else {\n zr.setBackgroundColor(backgroundColor); // Force set dark mode.\n\n if (darkMode != null && darkMode !== 'auto') {\n zr.setDarkMode(darkMode);\n }\n }\n\n lifecycle.trigger('afterupdate', ecModel, api);\n },\n updateTransform: function (payload) {\n var _this = this;\n\n var ecModel = this._model;\n var api = this._api; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload); // ChartView.markUpdateMethod(payload, 'updateTransform');\n\n var componentDirtyList = [];\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType === 'series') {\n return;\n }\n\n var componentView = _this.getViewOfComponentModel(componentModel);\n\n if (componentView && componentView.__alive) {\n if (componentView.updateTransform) {\n var result = componentView.updateTransform(componentModel, ecModel, api, payload);\n result && result.update && componentDirtyList.push(componentView);\n } else {\n componentDirtyList.push(componentView);\n }\n }\n });\n var seriesDirtyMap = createHashMap();\n ecModel.eachSeries(function (seriesModel) {\n var chartView = _this._chartsMap[seriesModel.__viewId];\n\n if (chartView.updateTransform) {\n var result = chartView.updateTransform(seriesModel, ecModel, api, payload);\n result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);\n } else {\n seriesDirtyMap.set(seriesModel.uid, 1);\n }\n });\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true);\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n setDirty: true,\n dirtyMap: seriesDirtyMap\n }); // Currently, not call render of components. Geo render cost a lot.\n // renderComponents(ecIns, ecModel, api, payload, componentDirtyList);\n\n\n renderSeries(this, ecModel, api, payload, {}, seriesDirtyMap);\n lifecycle.trigger('afterupdate', ecModel, api);\n },\n updateView: function (payload) {\n var ecModel = this._model; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload);\n ChartView.markUpdateMethod(payload, 'updateView');\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n setDirty: true\n });\n\n render(this, ecModel, this._api, payload, {});\n lifecycle.trigger('afterupdate', ecModel, this._api);\n },\n updateVisual: function (payload) {\n // updateMethods.update.call(this, payload);\n var _this = this;\n\n var ecModel = this._model; // update before setOption\n\n if (!ecModel) {\n return;\n }\n\n ecModel.setUpdatePayload(payload); // clear all visual\n\n ecModel.eachSeries(function (seriesModel) {\n seriesModel.getData().clearAllVisual();\n }); // Perform visual\n\n ChartView.markUpdateMethod(payload, 'updateVisual');\n clearColorPalette(ecModel); // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline.\n\n this._scheduler.performVisualTasks(ecModel, payload, {\n visualType: 'visual',\n setDirty: true\n });\n\n ecModel.eachComponent(function (componentType, componentModel) {\n if (componentType !== 'series') {\n var componentView = _this.getViewOfComponentModel(componentModel);\n\n componentView && componentView.__alive && componentView.updateVisual(componentModel, ecModel, _this._api, payload);\n }\n });\n ecModel.eachSeries(function (seriesModel) {\n var chartView = _this._chartsMap[seriesModel.__viewId];\n chartView.updateVisual(seriesModel, ecModel, _this._api, payload);\n });\n lifecycle.trigger('afterupdate', ecModel, this._api);\n },\n updateLayout: function (payload) {\n updateMethods.update.call(this, payload);\n }\n };\n\n doConvertPixel = function (ecIns, methodName, finder, value) {\n if (ecIns._disposed) {\n disposedWarning(ecIns.id);\n return;\n }\n\n var ecModel = ecIns._model;\n\n var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();\n\n var result;\n var parsedFinder = modelUtil.parseFinder(ecModel, finder);\n\n for (var i = 0; i < coordSysList.length; i++) {\n var coordSys = coordSysList[i];\n\n if (coordSys[methodName] && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {\n return result;\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n console.warn('No coordinate system that supports ' + methodName + ' found by the given finder.');\n }\n };\n\n updateStreamModes = function (ecIns, ecModel) {\n var chartsMap = ecIns._chartsMap;\n var scheduler = ecIns._scheduler;\n ecModel.eachSeries(function (seriesModel) {\n scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);\n });\n };\n\n doDispatchAction = function (payload, silent) {\n var _this = this;\n\n var ecModel = this.getModel();\n var payloadType = payload.type;\n var escapeConnect = payload.escapeConnect;\n var actionWrap = actions[payloadType];\n var actionInfo = actionWrap.actionInfo;\n var cptTypeTmp = (actionInfo.update || 'update').split(':');\n var updateMethod = cptTypeTmp.pop();\n var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);\n this[IN_MAIN_PROCESS_KEY] = true;\n var payloads = [payload];\n var batched = false; // Batch action\n\n if (payload.batch) {\n batched = true;\n payloads = map(payload.batch, function (item) {\n item = defaults(extend({}, item), payload);\n item.batch = null;\n return item;\n });\n }\n\n var eventObjBatch = [];\n var eventObj;\n var isSelectChange = isSelectChangePayload(payload);\n var isHighDown = isHighDownPayload(payload);\n each(payloads, function (batchItem) {\n // Action can specify the event by return it.\n eventObj = actionWrap.action(batchItem, _this._model, _this._api); // Emit event outside\n\n eventObj = eventObj || extend({}, batchItem); // Convert type to eventType\n\n eventObj.type = actionInfo.event || eventObj.type;\n eventObjBatch.push(eventObj); // light update does not perform data process, layout and visual.\n\n if (isHighDown) {\n var _a = modelUtil.preParseFinder(payload),\n queryOptionMap = _a.queryOptionMap,\n mainTypeSpecified = _a.mainTypeSpecified;\n\n var componentMainType = mainTypeSpecified ? queryOptionMap.keys()[0] : 'series';\n updateDirectly(_this, updateMethod, batchItem, componentMainType);\n markStatusToUpdate(_this);\n } else if (isSelectChange) {\n // At present `dispatchAction({ type: 'select', ... })` is not supported on components.\n // geo still use 'geoselect'.\n updateDirectly(_this, updateMethod, batchItem, 'series');\n markStatusToUpdate(_this);\n } else if (cptType) {\n updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);\n }\n });\n\n if (updateMethod !== 'none' && !isHighDown && !isSelectChange && !cptType) {\n // Still dirty\n if (this[PENDING_UPDATE]) {\n prepare(this);\n updateMethods.update.call(this, payload);\n this[PENDING_UPDATE] = null;\n } else {\n updateMethods[updateMethod].call(this, payload);\n }\n } // Follow the rule of action batch\n\n\n if (batched) {\n eventObj = {\n type: actionInfo.event || payloadType,\n escapeConnect: escapeConnect,\n batch: eventObjBatch\n };\n } else {\n eventObj = eventObjBatch[0];\n }\n\n this[IN_MAIN_PROCESS_KEY] = false;\n\n if (!silent) {\n var messageCenter = this._messageCenter;\n messageCenter.trigger(eventObj.type, eventObj); // Extra triggered 'selectchanged' event\n\n if (isSelectChange) {\n var newObj = {\n type: 'selectchanged',\n escapeConnect: escapeConnect,\n selected: getAllSelectedIndices(ecModel),\n isFromClick: payload.isFromClick || false,\n fromAction: payload.type,\n fromActionPayload: payload\n };\n messageCenter.trigger(newObj.type, newObj);\n }\n }\n };\n\n flushPendingActions = function (silent) {\n var pendingActions = this._pendingActions;\n\n while (pendingActions.length) {\n var payload = pendingActions.shift();\n doDispatchAction.call(this, payload, silent);\n }\n };\n\n triggerUpdatedEvent = function (silent) {\n !silent && this.trigger('updated');\n };\n /**\n * Event `rendered` is triggered when zr\n * rendered. It is useful for realtime\n * snapshot (reflect animation).\n *\n * Event `finished` is triggered when:\n * (1) zrender rendering finished.\n * (2) initial animation finished.\n * (3) progressive rendering finished.\n * (4) no pending action.\n * (5) no delayed setOption needs to be processed.\n */\n\n\n bindRenderedEvent = function (zr, ecIns) {\n zr.on('rendered', function (params) {\n ecIns.trigger('rendered', params); // The `finished` event should not be triggered repeatly,\n // so it should only be triggered when rendering indeed happend\n // in zrender. (Consider the case that dipatchAction is keep\n // triggering when mouse move).\n\n if ( // Although zr is dirty if initial animation is not finished\n // and this checking is called on frame, we also check\n // animation finished for robustness.\n zr.animation.isFinished() && !ecIns[PENDING_UPDATE] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) {\n ecIns.trigger('finished');\n }\n });\n };\n\n bindMouseEvent = function (zr, ecIns) {\n zr.on('mouseover', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\n\n if (dispatcher) {\n handleGlobalMouseOverForHighDown(dispatcher, e, ecIns._api);\n markStatusToUpdate(ecIns);\n }\n }).on('mouseout', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, isHighDownDispatcher);\n\n if (dispatcher) {\n handleGlboalMouseOutForHighDown(dispatcher, e, ecIns._api);\n markStatusToUpdate(ecIns);\n }\n }).on('click', function (e) {\n var el = e.target;\n var dispatcher = findEventDispatcher(el, function (target) {\n return getECData(target).dataIndex != null;\n }, true);\n\n if (dispatcher) {\n var actionType = dispatcher.selected ? 'unselect' : 'select';\n var ecData = getECData(dispatcher);\n\n ecIns._api.dispatchAction({\n type: actionType,\n dataType: ecData.dataType,\n dataIndexInside: ecData.dataIndex,\n seriesIndex: ecData.seriesIndex,\n isFromClick: true\n });\n }\n });\n };\n\n clearColorPalette = function (ecModel) {\n ecModel.clearColorPalette();\n ecModel.eachSeries(function (seriesModel) {\n seriesModel.clearColorPalette();\n });\n };\n\n render = function (ecIns, ecModel, api, payload, updateParams) {\n renderComponents(ecIns, ecModel, api, payload, updateParams);\n each(ecIns._chartsViews, function (chart) {\n chart.__alive = false;\n });\n renderSeries(ecIns, ecModel, api, payload, updateParams); // Remove groups of unrendered charts\n\n each(ecIns._chartsViews, function (chart) {\n if (!chart.__alive) {\n chart.remove(ecModel, api);\n }\n });\n };\n\n renderComponents = function (ecIns, ecModel, api, payload, updateParams, dirtyList) {\n each(dirtyList || ecIns._componentsViews, function (componentView) {\n var componentModel = componentView.__model;\n clearStates(componentModel, componentView);\n componentView.render(componentModel, ecModel, api, payload);\n updateZ(componentModel, componentView);\n updateStates(componentModel, componentView);\n });\n };\n /**\n * Render each chart and component\n */\n\n\n renderSeries = function (ecIns, ecModel, api, payload, updateParams, dirtyMap) {\n // Render all charts\n var scheduler = ecIns._scheduler;\n updateParams = extend(updateParams || {}, {\n updatedSeries: ecModel.getSeries()\n }); // TODO progressive?\n\n lifecycle.trigger('series:beforeupdate', ecModel, api, updateParams);\n var unfinished = false;\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n chartView.__alive = true;\n var renderTask = chartView.renderTask;\n scheduler.updatePayload(renderTask, payload); // TODO states on marker.\n\n clearStates(seriesModel, chartView);\n\n if (dirtyMap && dirtyMap.get(seriesModel.uid)) {\n renderTask.dirty();\n }\n\n if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {\n unfinished = true;\n }\n\n chartView.group.silent = !!seriesModel.get('silent'); // Should not call markRedraw on group, because it will disable zrender\n // increamental render (alway render from the __startIndex each frame)\n // chartView.group.markRedraw();\n\n updateBlend(seriesModel, chartView);\n updateSeriesElementSelection(seriesModel);\n });\n scheduler.unfinished = unfinished || scheduler.unfinished;\n lifecycle.trigger('series:layoutlabels', ecModel, api, updateParams); // transition after label is layouted.\n\n lifecycle.trigger('series:transition', ecModel, api, updateParams);\n ecModel.eachSeries(function (seriesModel) {\n var chartView = ecIns._chartsMap[seriesModel.__viewId]; // Update Z after labels updated. Before applying states.\n\n updateZ(seriesModel, chartView); // NOTE: Update states after label is updated.\n // label should be in normal status when layouting.\n\n updateStates(seriesModel, chartView);\n }); // If use hover layer\n\n updateHoverLayerStatus(ecIns, ecModel);\n lifecycle.trigger('series:afterupdate', ecModel, api, updateParams);\n };\n\n markStatusToUpdate = function (ecIns) {\n ecIns[STATUS_NEEDS_UPDATE_KEY] = true; // Wake up zrender if it's sleep. Let it update states in the next frame.\n\n ecIns.getZr().wakeUp();\n };\n\n applyChangedStates = function (ecIns) {\n if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {\n return;\n }\n\n ecIns.getZr().storage.traverse(function (el) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n\n applyElementStates(el);\n });\n ecIns[STATUS_NEEDS_UPDATE_KEY] = false;\n };\n\n function applyElementStates(el) {\n var newStates = [];\n var oldStates = el.currentStates; // Keep other states.\n\n for (var i = 0; i < oldStates.length; i++) {\n var stateName = oldStates[i];\n\n if (!(stateName === 'emphasis' || stateName === 'blur' || stateName === 'select')) {\n newStates.push(stateName);\n }\n } // Only use states when it's exists.\n\n\n if (el.selected && el.states.select) {\n newStates.push('select');\n }\n\n if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {\n newStates.push('emphasis');\n } else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {\n newStates.push('blur');\n }\n\n el.useStates(newStates);\n }\n\n function updateHoverLayerStatus(ecIns, ecModel) {\n var zr = ecIns._zr;\n var storage = zr.storage;\n var elCount = 0;\n storage.traverse(function (el) {\n if (!el.isGroup) {\n elCount++;\n }\n });\n\n if (elCount > ecModel.get('hoverLayerThreshold') && !env.node && !env.worker) {\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.preventUsingHoverLayer) {\n return;\n }\n\n var chartView = ecIns._chartsMap[seriesModel.__viewId];\n\n if (chartView.__alive) {\n chartView.group.traverse(function (el) {\n if (el.states.emphasis) {\n el.states.emphasis.hoverLayer = true;\n }\n });\n }\n });\n }\n }\n\n ;\n /**\n * Update chart and blend.\n */\n\n function updateBlend(seriesModel, chartView) {\n var blendMode = seriesModel.get('blendMode') || null;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!env.canvasSupported && blendMode && blendMode !== 'source-over') {\n console.warn('Only canvas support blendMode');\n }\n }\n\n chartView.group.traverse(function (el) {\n // FIXME marker and other components\n if (!el.isGroup) {\n // DONT mark the element dirty. In case element is incremental and don't wan't to rerender.\n el.style.blend = blendMode;\n }\n\n if (el.eachPendingDisplayable) {\n el.eachPendingDisplayable(function (displayable) {\n displayable.style.blend = blendMode;\n });\n }\n });\n }\n\n ;\n\n function updateZ(model, view) {\n if (model.preventAutoZ) {\n return;\n } // Set z and zlevel\n\n\n _updateZ(view.group, model.get('z') || 0, model.get('zlevel') || 0, -Infinity);\n }\n\n ;\n\n function _updateZ(el, z, zlevel, maxZ2) {\n // Group may also have textContent\n var label = el.getTextContent();\n var labelLine = el.getTextGuideLine();\n var isGroup = el.isGroup;\n\n if (isGroup) {\n // set z & zlevel of children elements of Group\n // el.traverse((childEl: Element) => _updateZ(childEl, z, zlevel));\n var children = el.childrenRef();\n\n for (var i = 0; i < children.length; i++) {\n maxZ2 = Math.max(_updateZ(children[i], z, zlevel, maxZ2), maxZ2);\n }\n } else {\n // not Group\n el.z = z;\n el.zlevel = zlevel;\n maxZ2 = Math.max(el.z2, maxZ2);\n } // always set z and zlevel if label/labelLine exists\n\n\n if (label) {\n label.z = z;\n label.zlevel = zlevel; // lift z2 of text content\n // TODO if el.emphasis.z2 is spcefied, what about textContent.\n\n isFinite(maxZ2) && (label.z2 = maxZ2 + 2);\n }\n\n if (labelLine) {\n var textGuideLineConfig = el.textGuideLineConfig;\n labelLine.z = z;\n labelLine.zlevel = zlevel;\n isFinite(maxZ2) && (labelLine.z2 = maxZ2 + (textGuideLineConfig && textGuideLineConfig.showAbove ? 1 : -1));\n }\n\n return maxZ2;\n } // Clear states without animation.\n // TODO States on component.\n\n\n function clearStates(model, view) {\n view.group.traverse(function (el) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine();\n\n if (el.stateTransition) {\n el.stateTransition = null;\n }\n\n if (textContent && textContent.stateTransition) {\n textContent.stateTransition = null;\n }\n\n if (textGuide && textGuide.stateTransition) {\n textGuide.stateTransition = null;\n } // TODO If el is incremental.\n\n\n if (el.hasState()) {\n el.prevStates = el.currentStates;\n el.clearStates();\n } else if (el.prevStates) {\n el.prevStates = null;\n }\n });\n }\n\n function updateStates(model, view) {\n var stateAnimationModel = model.getModel('stateAnimation');\n var enableAnimation = model.isAnimationEnabled();\n var duration = stateAnimationModel.get('duration');\n var stateTransition = duration > 0 ? {\n duration: duration,\n delay: stateAnimationModel.get('delay'),\n easing: stateAnimationModel.get('easing') // additive: stateAnimationModel.get('additive')\n\n } : null;\n view.group.traverse(function (el) {\n if (el.states && el.states.emphasis) {\n // Not applied on removed elements, it may still in fading.\n if (graphic.isElementRemoved(el)) {\n return;\n }\n\n if (el instanceof graphic.Path) {\n savePathStates(el);\n } // Only updated on changed element. In case element is incremental and don't wan't to rerender.\n // TODO, a more proper way?\n\n\n if (el.__dirty) {\n var prevStates = el.prevStates; // Restore states without animation\n\n if (prevStates) {\n el.useStates(prevStates);\n }\n } // Update state transition and enable animation again.\n\n\n if (enableAnimation) {\n el.stateTransition = stateTransition;\n var textContent = el.getTextContent();\n var textGuide = el.getTextGuideLine(); // TODO Is it necessary to animate label?\n\n if (textContent) {\n textContent.stateTransition = stateTransition;\n }\n\n if (textGuide) {\n textGuide.stateTransition = stateTransition;\n }\n } // The use higlighted and selected flag to toggle states.\n\n\n if (el.__dirty) {\n applyElementStates(el);\n }\n }\n });\n }\n\n ;\n\n createExtensionAPI = function (ecIns) {\n return new (\n /** @class */\n function (_super) {\n __extends(class_1, _super);\n\n function class_1() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n class_1.prototype.getCoordinateSystems = function () {\n return ecIns._coordSysMgr.getCoordinateSystems();\n };\n\n class_1.prototype.getComponentByElement = function (el) {\n while (el) {\n var modelInfo = el.__ecComponentInfo;\n\n if (modelInfo != null) {\n return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);\n }\n\n el = el.parent;\n }\n };\n\n class_1.prototype.enterEmphasis = function (el, highlightDigit) {\n enterEmphasis(el, highlightDigit);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.leaveEmphasis = function (el, highlightDigit) {\n leaveEmphasis(el, highlightDigit);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.enterBlur = function (el) {\n enterBlur(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.leaveBlur = function (el) {\n leaveBlur(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.enterSelect = function (el) {\n enterSelect(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.leaveSelect = function (el) {\n leaveSelect(el);\n markStatusToUpdate(ecIns);\n };\n\n class_1.prototype.getModel = function () {\n return ecIns.getModel();\n };\n\n class_1.prototype.getViewOfComponentModel = function (componentModel) {\n return ecIns.getViewOfComponentModel(componentModel);\n };\n\n class_1.prototype.getViewOfSeriesModel = function (seriesModel) {\n return ecIns.getViewOfSeriesModel(seriesModel);\n };\n\n return class_1;\n }(ExtensionAPI))(ecIns);\n };\n\n enableConnect = function (chart) {\n function updateConnectedChartsStatus(charts, status) {\n for (var i = 0; i < charts.length; i++) {\n var otherChart = charts[i];\n otherChart[CONNECT_STATUS_KEY] = status;\n }\n }\n\n each(eventActionMap, function (actionType, eventType) {\n chart._messageCenter.on(eventType, function (event) {\n if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {\n if (event && event.escapeConnect) {\n return;\n }\n\n var action_1 = chart.makeActionFromEvent(event);\n var otherCharts_1 = [];\n each(instances, function (otherChart) {\n if (otherChart !== chart && otherChart.group === chart.group) {\n otherCharts_1.push(otherChart);\n }\n });\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);\n each(otherCharts_1, function (otherChart) {\n if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {\n otherChart.dispatchAction(action_1);\n }\n });\n updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);\n }\n });\n });\n };\n }();\n\n return ECharts;\n}(Eventful);\n\nvar echartsProto = ECharts.prototype;\nechartsProto.on = createRegisterEventWithLowercaseECharts('on');\nechartsProto.off = createRegisterEventWithLowercaseECharts('off');\n/**\n * @deprecated\n */\n// @ts-ignore\n\nechartsProto.one = function (eventName, cb, ctx) {\n var self = this;\n deprecateLog('ECharts#one is deprecated.');\n\n function wrapped() {\n var args2 = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args2[_i] = arguments[_i];\n }\n\n cb && cb.apply && cb.apply(this, args2); // @ts-ignore\n\n self.off(eventName, wrapped);\n }\n\n ; // @ts-ignore\n\n this.on.call(this, eventName, wrapped, ctx);\n}; // /**\n// * Encode visual infomation from data after data processing\n// *\n// * @param {module:echarts/model/Global} ecModel\n// * @param {object} layout\n// * @param {boolean} [layoutFilter] `true`: only layout,\n// * `false`: only not layout,\n// * `null`/`undefined`: all.\n// * @param {string} taskBaseTag\n// * @private\n// */\n// function startVisualEncoding(ecIns, ecModel, api, payload, layoutFilter) {\n// each(visualFuncs, function (visual, index) {\n// let isLayout = visual.isLayout;\n// if (layoutFilter == null\n// || (layoutFilter === false && !isLayout)\n// || (layoutFilter === true && isLayout)\n// ) {\n// visual.func(ecModel, api, payload);\n// }\n// });\n// }\n\n\nvar MOUSE_EVENT_NAMES = ['click', 'dblclick', 'mouseover', 'mouseout', 'mousemove', 'mousedown', 'mouseup', 'globalout', 'contextmenu'];\n\nfunction disposedWarning(id) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('Instance ' + id + ' has been disposed');\n }\n}\n\nvar actions = {};\n/**\n * Map eventType to actionType\n */\n\nvar eventActionMap = {};\nvar dataProcessorFuncs = [];\nvar optionPreprocessorFuncs = [];\nvar visualFuncs = [];\nvar themeStorage = {};\nvar loadingEffects = {};\nvar instances = {};\nvar connectedGroups = {};\nvar idBase = +new Date() - 0;\nvar groupIdBase = +new Date() - 0;\nvar DOM_ATTRIBUTE_KEY = '_echarts_instance_';\n/**\n * @param opts.devicePixelRatio Use window.devicePixelRatio by default\n * @param opts.renderer Can choose 'canvas' or 'svg' to render the chart.\n * @param opts.width Use clientWidth of the input `dom` by default.\n * Can be 'auto' (the same as null/undefined)\n * @param opts.height Use clientHeight of the input `dom` by default.\n * Can be 'auto' (the same as null/undefined)\n * @param opts.locale Specify the locale.\n * @param opts.useDirtyRect Enable dirty rectangle rendering or not.\n */\n\nexport function init(dom, theme, opts) {\n if (process.env.NODE_ENV !== 'production') {\n if (!dom) {\n throw new Error('Initialize failed: invalid dom.');\n }\n }\n\n var existInstance = getInstanceByDom(dom);\n\n if (existInstance) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('There is a chart instance already initialized on the dom.');\n }\n\n return existInstance;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (isDom(dom) && dom.nodeName.toUpperCase() !== 'CANVAS' && (!dom.clientWidth && (!opts || opts.width == null) || !dom.clientHeight && (!opts || opts.height == null))) {\n console.warn('Can\\'t get DOM width or height. Please check ' + 'dom.clientWidth and dom.clientHeight. They should not be 0.' + 'For example, you may need to call this in the callback ' + 'of window.onload.');\n }\n }\n\n var chart = new ECharts(dom, theme, opts);\n chart.id = 'ec_' + idBase++;\n instances[chart.id] = chart;\n modelUtil.setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);\n enableConnect(chart);\n lifecycle.trigger('afterinit', chart);\n return chart;\n}\n/**\n * @usage\n * (A)\n * ```js\n * let chart1 = echarts.init(dom1);\n * let chart2 = echarts.init(dom2);\n * chart1.group = 'xxx';\n * chart2.group = 'xxx';\n * echarts.connect('xxx');\n * ```\n * (B)\n * ```js\n * let chart1 = echarts.init(dom1);\n * let chart2 = echarts.init(dom2);\n * echarts.connect('xxx', [chart1, chart2]);\n * ```\n */\n\nexport function connect(groupId) {\n // Is array of charts\n if (isArray(groupId)) {\n var charts = groupId;\n groupId = null; // If any chart has group\n\n each(charts, function (chart) {\n if (chart.group != null) {\n groupId = chart.group;\n }\n });\n groupId = groupId || 'g_' + groupIdBase++;\n each(charts, function (chart) {\n chart.group = groupId;\n });\n }\n\n connectedGroups[groupId] = true;\n return groupId;\n}\n/**\n * @deprecated\n */\n\nexport function disConnect(groupId) {\n connectedGroups[groupId] = false;\n}\n/**\n * Alias and backword compat\n */\n\nexport var disconnect = disConnect;\n/**\n * Dispose a chart instance\n */\n\nexport function dispose(chart) {\n if (typeof chart === 'string') {\n chart = instances[chart];\n } else if (!(chart instanceof ECharts)) {\n // Try to treat as dom\n chart = getInstanceByDom(chart);\n }\n\n if (chart instanceof ECharts && !chart.isDisposed()) {\n chart.dispose();\n }\n}\nexport function getInstanceByDom(dom) {\n return instances[modelUtil.getAttribute(dom, DOM_ATTRIBUTE_KEY)];\n}\nexport function getInstanceById(key) {\n return instances[key];\n}\n/**\n * Register theme\n */\n\nexport function registerTheme(name, theme) {\n themeStorage[name] = theme;\n}\n/**\n * Register option preprocessor\n */\n\nexport function registerPreprocessor(preprocessorFunc) {\n if (indexOf(optionPreprocessorFuncs, preprocessorFunc) < 0) {\n optionPreprocessorFuncs.push(preprocessorFunc);\n }\n}\nexport function registerProcessor(priority, processor) {\n normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);\n}\n/**\n * Register postIniter\n * @param {Function} postInitFunc\n */\n\nexport function registerPostInit(postInitFunc) {\n registerUpdateLifecycle('afterinit', postInitFunc);\n}\n/**\n * Register postUpdater\n * @param {Function} postUpdateFunc\n */\n\nexport function registerPostUpdate(postUpdateFunc) {\n registerUpdateLifecycle('afterupdate', postUpdateFunc);\n}\nexport function registerUpdateLifecycle(name, cb) {\n lifecycle.on(name, cb);\n}\nexport function registerAction(actionInfo, eventName, action) {\n if (typeof eventName === 'function') {\n action = eventName;\n eventName = '';\n }\n\n var actionType = isObject(actionInfo) ? actionInfo.type : [actionInfo, actionInfo = {\n event: eventName\n }][0]; // Event name is all lowercase\n\n actionInfo.event = (actionInfo.event || actionType).toLowerCase();\n eventName = actionInfo.event;\n\n if (eventActionMap[eventName]) {\n // Already registered.\n return;\n } // Validate action type and event name.\n\n\n assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));\n\n if (!actions[actionType]) {\n actions[actionType] = {\n action: action,\n actionInfo: actionInfo\n };\n }\n\n eventActionMap[eventName] = actionType;\n}\nexport function registerCoordinateSystem(type, coordSysCreator) {\n CoordinateSystemManager.register(type, coordSysCreator);\n}\n/**\n * Get dimensions of specified coordinate system.\n * @param {string} type\n * @return {Array.}\n */\n\nexport function getCoordinateSystemDimensions(type) {\n var coordSysCreator = CoordinateSystemManager.get(type);\n\n if (coordSysCreator) {\n return coordSysCreator.getDimensionsInfo ? coordSysCreator.getDimensionsInfo() : coordSysCreator.dimensions.slice();\n }\n}\nexport { registerLocale } from './locale';\n\nfunction registerLayout(priority, layoutTask) {\n normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout');\n}\n\nfunction registerVisual(priority, visualTask) {\n normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual');\n}\n\nexport { registerLayout, registerVisual };\nvar registeredTasks = [];\n\nfunction normalizeRegister(targetList, priority, fn, defaultPriority, visualType) {\n if (isFunction(priority) || isObject(priority)) {\n fn = priority;\n priority = defaultPriority;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (isNaN(priority) || priority == null) {\n throw new Error('Illegal priority');\n } // Check duplicate\n\n\n each(targetList, function (wrap) {\n assert(wrap.__raw !== fn);\n });\n } // Already registered\n\n\n if (indexOf(registeredTasks, fn) >= 0) {\n return;\n }\n\n registeredTasks.push(fn);\n var stageHandler = Scheduler.wrapStageHandler(fn, visualType);\n stageHandler.__prio = priority;\n stageHandler.__raw = fn;\n targetList.push(stageHandler);\n}\n\nexport function registerLoading(name, loadingFx) {\n loadingEffects[name] = loadingFx;\n}\n/**\n * ZRender need a canvas context to do measureText.\n * But in node environment canvas may be created by node-canvas.\n * So we need to specify how to create a canvas instead of using document.createElement('canvas')\n *\n * Be careful of using it in the browser.\n *\n * @example\n * let Canvas = require('canvas');\n * let echarts = require('echarts');\n * echarts.setCanvasCreator(function () {\n * // Small size is enough.\n * return new Canvas(32, 32);\n * });\n */\n\nexport function setCanvasCreator(creator) {\n $override('createCanvas', creator);\n}\n/**\n * The parameters and usage: see `geoSourceManager.registerMap`.\n * Compatible with previous `echarts.registerMap`.\n */\n\nexport function registerMap(mapName, geoJson, specialAreas) {\n geoSourceManager.registerMap(mapName, geoJson, specialAreas);\n}\nexport function getMap(mapName) {\n return geoSourceManager.getMapForUser(mapName);\n}\nexport var registerTransform = registerExternalTransform;\n/**\n * Globa dispatchAction to a specified chart instance.\n */\n// export function dispatchAction(payload: { chartId: string } & Payload, opt?: Parameters[1]) {\n// if (!payload || !payload.chartId) {\n// // Must have chartId to find chart\n// return;\n// }\n// const chart = instances[payload.chartId];\n// if (chart) {\n// chart.dispatchAction(payload, opt);\n// }\n// }\n// Buitlin global visual\n\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);\nregisterVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);\nregisterVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);\nregisterVisual(PRIORITY_VISUAL_DECAL, decal);\nregisterPreprocessor(backwardCompat);\nregisterProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);\nregisterLoading('default', loadingDefault); // Default actions\n\nregisterAction({\n type: HIGHLIGHT_ACTION_TYPE,\n event: HIGHLIGHT_ACTION_TYPE,\n update: HIGHLIGHT_ACTION_TYPE\n}, noop);\nregisterAction({\n type: DOWNPLAY_ACTION_TYPE,\n event: DOWNPLAY_ACTION_TYPE,\n update: DOWNPLAY_ACTION_TYPE\n}, noop);\nregisterAction({\n type: SELECT_ACTION_TYPE,\n event: SELECT_ACTION_TYPE,\n update: SELECT_ACTION_TYPE\n}, noop);\nregisterAction({\n type: UNSELECT_ACTION_TYPE,\n event: UNSELECT_ACTION_TYPE,\n update: UNSELECT_ACTION_TYPE\n}, noop);\nregisterAction({\n type: TOGGLE_SELECT_ACTION_TYPE,\n event: TOGGLE_SELECT_ACTION_TYPE,\n update: TOGGLE_SELECT_ACTION_TYPE\n}, noop); // Default theme\n\nregisterTheme('light', lightTheme);\nregisterTheme('dark', darkTheme); // For backward compatibility, where the namespace `dataTool` will\n// be mounted on `echarts` is the extension `dataTool` is imported.\n\nexport var dataTool = {};","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n\n/**\n * AUTO-GENERATED FILE. DO NOT MODIFY.\n */\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nimport { isTypedArray, clone, createHashMap, isArray, isObject, isArrayLike, hasOwn, assert, each, map, isNumber, isString } from 'zrender/lib/core/util';\nimport { SOURCE_FORMAT_ORIGINAL, SERIES_LAYOUT_BY_COLUMN, SOURCE_FORMAT_UNKNOWN, SOURCE_FORMAT_KEYED_COLUMNS, SOURCE_FORMAT_TYPED_ARRAY, SOURCE_FORMAT_ARRAY_ROWS, SOURCE_FORMAT_OBJECT_ROWS, SERIES_LAYOUT_BY_ROW } from '../util/types';\nimport { getDataItemValue } from '../util/model';\nimport { BE_ORDINAL, guessOrdinal } from './helper/sourceHelper';\n; // @inner\n\nvar SourceImpl =\n/** @class */\nfunction () {\n function SourceImpl(fields) {\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN; // Visit config\n\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\n this.startIndex = fields.startIndex || 0;\n this.dimensionsDetectedCount = fields.dimensionsDetectedCount;\n this.metaRawOption = fields.metaRawOption;\n var dimensionsDefine = this.dimensionsDefine = fields.dimensionsDefine;\n\n if (dimensionsDefine) {\n for (var i = 0; i < dimensionsDefine.length; i++) {\n var dim = dimensionsDefine[i];\n\n if (dim.type == null) {\n if (guessOrdinal(this, i) === BE_ORDINAL.Must) {\n dim.type = 'ordinal';\n }\n }\n }\n }\n }\n\n return SourceImpl;\n}();\n\nexport function isSourceInstance(val) {\n return val instanceof SourceImpl;\n}\n/**\n * Create a source from option.\n * NOTE: Created source is immutable. Don't change any properties in it.\n */\n\nexport function createSource(sourceData, thisMetaRawOption, // can be null. If not provided, auto detect it from `sourceData`.\nsourceFormat) {\n sourceFormat = sourceFormat || detectSourceFormat(sourceData);\n var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;\n var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);\n var source = new SourceImpl({\n data: sourceData,\n sourceFormat: sourceFormat,\n seriesLayoutBy: seriesLayoutBy,\n dimensionsDefine: determined.dimensionsDefine,\n startIndex: determined.startIndex,\n dimensionsDetectedCount: determined.dimensionsDetectedCount,\n metaRawOption: clone(thisMetaRawOption)\n });\n return source;\n}\n/**\n * Wrap original series data for some compatibility cases.\n */\n\nexport function createSourceFromSeriesDataOption(data) {\n return new SourceImpl({\n data: data,\n sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL\n });\n}\n/**\n * Clone source but excludes source data.\n */\n\nexport function cloneSourceShallow(source) {\n return new SourceImpl({\n data: source.data,\n sourceFormat: source.sourceFormat,\n seriesLayoutBy: source.seriesLayoutBy,\n dimensionsDefine: clone(source.dimensionsDefine),\n startIndex: source.startIndex,\n dimensionsDetectedCount: source.dimensionsDetectedCount\n });\n}\n/**\n * Note: An empty array will be detected as `SOURCE_FORMAT_ARRAY_ROWS`.\n */\n\nexport function detectSourceFormat(data) {\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\n\n if (isTypedArray(data)) {\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\n } else if (isArray(data)) {\n // FIXME Whether tolerate null in top level array?\n if (data.length === 0) {\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n }\n\n for (var i = 0, len = data.length; i < len; i++) {\n var item = data[i];\n\n if (item == null) {\n continue;\n } else if (isArray(item)) {\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n break;\n } else if (isObject(item)) {\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\n break;\n }\n }\n } else if (isObject(data)) {\n for (var key in data) {\n if (hasOwn(data, key) && isArrayLike(data[key])) {\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\n break;\n }\n }\n }\n\n return sourceFormat;\n}\n/**\n * Determine the source definitions from data standalone dimensions definitions\n * are not specified.\n */\n\nfunction determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, // standalone raw dimensions definition, like:\n// {\n// dimensions: ['aa', 'bb', { name: 'cc', type: 'time' }]\n// }\n// in `dataset` or `series`\ndimensionsDefine) {\n var dimensionsDetectedCount;\n var startIndex; // PEDING: could data be null/undefined here?\n // currently, if `dataset.source` not specified, error thrown.\n // if `series.data` not specified, nothing rendered without error thrown.\n // Should test these cases.\n\n if (!data) {\n return {\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n startIndex: startIndex,\n dimensionsDetectedCount: dimensionsDetectedCount\n };\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n var dataArrayRows = data; // Rule: Most of the first line are string: it is header.\n // Caution: consider a line with 5 string and 1 number,\n // it still can not be sure it is a head, because the\n // 5 string may be 5 values of category columns.\n\n if (sourceHeader === 'auto' || sourceHeader == null) {\n arrayRowsTravelFirst(function (val) {\n // '-' is regarded as null/undefined.\n if (val != null && val !== '-') {\n if (isString(val)) {\n startIndex == null && (startIndex = 1);\n } else {\n startIndex = 0;\n }\n } // 10 is an experience number, avoid long loop.\n\n }, seriesLayoutBy, dataArrayRows, 10);\n } else {\n startIndex = isNumber(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;\n }\n\n if (!dimensionsDefine && startIndex === 1) {\n dimensionsDefine = [];\n arrayRowsTravelFirst(function (val, index) {\n dimensionsDefine[index] = val != null ? val + '' : '';\n }, seriesLayoutBy, dataArrayRows, Infinity);\n }\n\n dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[0].length : null;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n if (!dimensionsDefine) {\n dimensionsDefine = objectRowsCollectDimensions(data);\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimensionsDefine) {\n dimensionsDefine = [];\n each(data, function (colArr, key) {\n dimensionsDefine.push(key);\n });\n }\n } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var value0 = getDataItemValue(data[0]);\n dimensionsDetectedCount = isArray(value0) && value0.length || 1;\n } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {\n if (process.env.NODE_ENV !== 'production') {\n assert(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.');\n }\n }\n\n return {\n startIndex: startIndex,\n dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),\n dimensionsDetectedCount: dimensionsDetectedCount\n };\n}\n\nfunction objectRowsCollectDimensions(data) {\n var firstIndex = 0;\n var obj;\n\n while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line\n\n\n if (obj) {\n var dimensions_1 = [];\n each(obj, function (value, key) {\n dimensions_1.push(key);\n });\n return dimensions_1;\n }\n} // Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'],\n// which is reasonable. But dimension name is duplicated.\n// Returns undefined or an array contains only object without null/undefiend or string.\n\n\nfunction normalizeDimensionsOption(dimensionsDefine) {\n if (!dimensionsDefine) {\n // The meaning of null/undefined is different from empty array.\n return;\n }\n\n var nameMap = createHashMap();\n return map(dimensionsDefine, function (rawItem, index) {\n rawItem = isObject(rawItem) ? rawItem : {\n name: rawItem\n }; // Other fields will be discarded.\n\n var item = {\n name: rawItem.name,\n displayName: rawItem.displayName,\n type: rawItem.type\n }; // User can set null in dimensions.\n // We dont auto specify name, othewise a given name may\n // cause it be refered unexpectedly.\n\n if (item.name == null) {\n return item;\n } // Also consider number form like 2012.\n\n\n item.name += ''; // User may also specify displayName.\n // displayName will always exists except user not\n // specified or dim name is not specified or detected.\n // (A auto generated dim name will not be used as\n // displayName).\n\n if (item.displayName == null) {\n item.displayName = item.name;\n }\n\n var exist = nameMap.get(item.name);\n\n if (!exist) {\n nameMap.set(item.name, {\n count: 1\n });\n } else {\n item.name += '-' + exist.count++;\n }\n\n return item;\n });\n}\n\nfunction arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n for (var i = 0; i < data.length && i < maxLoop; i++) {\n cb(data[i] ? data[i][0] : null, i);\n }\n } else {\n var value0 = data[0] || [];\n\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\n cb(value0[i], i);\n }\n }\n}\n\nexport function shouldRetrieveDataByName(source) {\n var sourceFormat = source.sourceFormat;\n return sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS;\n}"],"sourceRoot":""}