{"version":3,"sources":["webpack:///./node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js","webpack:///./node_modules/echarts/lib/core/CoordinateSystem.js","webpack:///./node_modules/echarts/lib/coord/View.js","webpack:///./node_modules/echarts/lib/coord/CoordinateSystem.js","webpack:///./node_modules/echarts/lib/coord/geo/Region.js","webpack:///./node_modules/echarts/lib/coord/geo/GeoSVGResource.js","webpack:///./node_modules/echarts/lib/coord/geo/parseGeoJson.js","webpack:///./node_modules/echarts/lib/coord/geo/fix/nanhai.js","webpack:///./node_modules/echarts/lib/coord/geo/fix/textCoord.js","webpack:///./node_modules/echarts/lib/coord/geo/fix/geoCoord.js","webpack:///./node_modules/echarts/lib/coord/geo/fix/diaoyuIsland.js","webpack:///./node_modules/echarts/lib/coord/geo/GeoJSONResource.js","webpack:///./node_modules/echarts/lib/coord/geo/geoSourceManager.js","webpack:///./node_modules/echarts/lib/coord/axisDefault.js","webpack:///./node_modules/echarts/lib/coord/axisCommonTypes.js","webpack:///./node_modules/echarts/lib/coord/axisModelCreator.js","webpack:///./node_modules/echarts/lib/coord/axisModelCommonMixin.js","webpack:///./node_modules/echarts/lib/coord/cartesian/AxisModel.js","webpack:///./node_modules/echarts/lib/coord/cartesian/GridModel.js","webpack:///./node_modules/echarts/lib/coord/cartesian/Cartesian.js","webpack:///./node_modules/echarts/lib/coord/cartesian/Cartesian2D.js","webpack:///./node_modules/echarts/lib/coord/axisTickLabelBuilder.js","webpack:///./node_modules/echarts/lib/coord/Axis.js","webpack:///./node_modules/echarts/lib/coord/cartesian/Axis2D.js","webpack:///./node_modules/echarts/lib/coord/cartesian/Grid.js","webpack:///./node_modules/echarts/lib/coord/scaleRawExtentInfo.js","webpack:///./node_modules/echarts/lib/coord/axisHelper.js"],"names":["layout","gridModel","axisModel","opt","grid","coordinateSystem","axis","otherAxisOnZeroOf","getAxesOnZeroOf","rawAxisPosition","position","axisPosition","axisDim","dim","rect","getRect","rectBound","x","width","y","height","idx","left","right","top","bottom","onZero","axisOffset","get","posBound","onZeroCoord","toGlobalCoord","dataToCoord","Math","max","min","rotation","PI","labelDirection","tickDirection","nameDirection","labelOffset","labelInside","labelRotate","z2","isCartesian2DSeries","seriesModel","findAxisModels","axisModelMap","xAxisModel","yAxisModel","v","key","axisType","replace","getReferringComponents","models","coordinateSystemCreators","CoordinateSystemManager","this","_coordinateSystems","prototype","create","ecModel","api","coordinateSystems","creater","type","list","concat","update","coordSys","getCoordinateSystems","slice","register","creator","v2ApplyTransform","View","_super","name","_this","call","dimensions","_roamTransformable","_rawTransformable","setBoundingRect","_rect","getBoundingRect","setViewRect","_transformTo","_viewRect","rawTransform","transform","calculateTransform","rawParent","parent","decomposeTransform","_updateTransform","setCenter","centerCoord","_center","_updateCenterAndZoom","setZoom","zoom","zoomLimit","_zoom","getDefaultCenter","rawRect","getCenter","getZoom","getRoamTransform","getLocalTransform","rawTransformMatrix","roamTransform","defaultCenter","center","originX","originY","scaleX","scaleY","roamTransformable","rawTransformable","updateTransform","_rawTransform","invTransform","getTransformInfo","dummyTransformable","roam","raw","getViewRect","getViewRectAfterRoam","clone","applyTransform","dataToPoint","data","noRoam","out","pointToData","point","convertToPixel","finder","value","getCoordSys","convertFromPixel","pixel","containPoint","contain","isCoordinateSystemType","TMP_TRANSFORM","Region","GeoJSONRegion","geometries","cp","MAX_NUMBER","Number","MAX_VALUE","min2","max2","i","length","exterior","bbox","BoundingRect","coord","loopGeo","len","interiors","polygon","k","transformTo","aspect","target","p","h","copy","cloneShallow","newRegion","GeoSVGRegion","elOnlyForCalculate","_elOnlyForCalculate","_calculateCenter","el","mat","matrix","isGeoSVGGraphicRoot","REGION_AVAILABLE_SVG_TAG_MAP","GeoSVGResource","mapName","svg","_usedGraphicMap","_freedGraphics","_mapName","_parsedXML","parseXML","load","firstGraphic","_firstGraphic","_buildGraphic","push","_boundingRect","boundingRect","_a","named","regions","regionsMap","namedItem","namedFrom","region","set","createRegions","_regions","_regionsMap","svgXML","result","rootFromParse","parseSVG","ignoreViewBox","ignoreRootClip","root","e","Error","message","Group","add","svgWidth","svgHeight","viewBoxRect","bRectX","bRectY","bRectWidth","bRectHeight","calculatedBoundingRect","viewBoxTransform","scale","setClipPath","Rect","shape","plain","svgNodeTagLower","silent","isGroup","traverse","child","useGraphic","hostKey","usedRootMap","svgGraphic","pop","freeGraphic","removeKey","decodePolygon","coordinate","encodeOffsets","encodeScale","prevX","prevY","charCodeAt","parseGeoJSON","geoJson","nameProperty","json","UTF8Encoding","jsonCompressed","UTF8Scale","features","f","geometry","coordinates","c","c2","decode","featureObj","properties","geo","item","geoCoord","points","coordsOffsetMap","geoCoordMap","GeoJSONResource","geoJSON","specialAreas","source","_parsedMap","_specialAreas","_geoJSON","JSON","parse","Function","nameMap","parsed","rawRegions","_parseToRegions","calculateBoundingRect","finalRegions","regionName","hasOwnProperty","mapType","coordFix","fixDiaoyuIsland","specialArea","getMapForUser","regionRect","union","storage","registerMap","rawDef","rawSpecialAreas","resource","getGeoResource","show","zlevel","z","inverse","nameLocation","nameRotate","nameTruncate","maxWidth","ellipsis","placeholder","nameTextStyle","nameGap","triggerEvent","tooltip","axisPointer","axisLine","onZeroAxisIndex","lineStyle","color","symbol","symbolSize","axisTick","inside","axisLabel","rotate","showMinLabel","showMaxLabel","margin","fontSize","splitLine","splitArea","areaStyle","categoryAxis","boundaryGap","deduplication","alignWithLabel","interval","valueAxis","splitNumber","minorTick","minorSplitLine","category","time","rich","primary","fontWeight","log","logBase","AXIS_TYPES","axisModelCreator","registers","axisName","BaseAxisModelClass","extraDefaultOption","defaultOption","axisDefault","AxisModel","args","_i","arguments","apply","mergeDefaultAndTheme","option","layoutMode","inputPositionParams","themeModel","getTheme","getDefaultOption","getAxisType","optionUpdated","__ordinalMeta","OrdinalMeta","createByAxisModel","getCategories","rawData","categories","getOrdinalMeta","registerComponentModel","registerSubTypeDefaulter","AxisModelCommonMixin","getNeedCrossZero","getCoordSysModel","CartesianAxisModel","Component","GridModel","dependencies","containLabel","backgroundColor","borderWidth","borderColor","Cartesian","_dimList","_axes","getAxis","getAxes","getAxesByScale","scaleType","toLowerCase","addAxis","cartesian2DDimensions","canCalculateAffineTransform","Cartesian2D","calcAffineTransform","_transform","_invTransform","xAxisScale","yAxisScale","xScaleExtent","getExtent","yScaleExtent","start","end","xScaleSpan","yScaleSpan","translateX","translateY","m","getBaseAxis","axisX","axisY","toLocalCoord","containData","reserved","xVal","yVal","isFinite","xAxis","yAxis","clampData","xScale","yScale","xAxisExtent","yAxisExtent","coordToData","getOtherAxis","getArea","xExtent","getGlobalExtent","yExtent","inner","createAxisLabels","labelModel","getLabelModel","makeCategoryLabelsActually","isBlank","labels","labelCategoryInterval","makeCategoryLabels","ticks","getTicks","labelFormatter","tick","formattedLabel","rawLabel","getLabel","tickValue","makeRealNumberLabels","createAxisTicks","tickModel","tickCategoryInterval","ticksCache","getListCache","optionTickInterval","listCacheGet","makeLabelsByCustomizedCategoryInterval","labelsResult","labelItem","makeLabelsByNumericCategoryInterval","listCacheSet","makeCategoryTicks","numericLabelInterval","labelsCache","optionLabelInterval","autoInterval","calculateCategoryInterval","makeAutoCategoryInterval","prop","cache","categoryInterval","onlyTick","ordinalScale","ordinalExtent","step","startTick","tickCount","count","round","ceil","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tickObj","NORMALIZED_EXTENT","fixExtentWithBands","extent","nTick","Axis2D","coordExtent","index","isHorizontal","asc","ret","reverse","clamp","setCategorySortInfo","info","model","categorySortInfo","setSortInfo","Axis","onBand","_extent","getPixelPrecision","dataExtent","setExtent","normalize","t","getTicksCoords","getTickModel","ticksCoords","tickVal","getRawOrdinalNumber","ticksLen","last","diffSize","axisExtent","crossLen","shift_1","ticksItem","littleThan","shift","unshift","a","b","fixOnBandTicksCoords","getMinorTicksCoords","getModel","minorTicks","getMinorTicks","minorTicksGroup","getViewLabels","getBandWidth","size","abs","params","axisRotate","getRotate","font","getFont","fetchAutoCategoryIntervalCalculationParams","floor","unitSpan","unitW","cos","unitH","sin","maxW","maxH","dw","dh","isNaN","Infinity","lastAutoInterval","lastTickCount","axisExtent0","axisExtent1","Grid","_coordsMap","_coordsList","_axesMap","_axesList","axisPointerEnabled","_initCartesian","axesMap","_updateScale","onZeroRecords","fixAxisOnZero","resize","ignoreContainLabel","boxLayoutParams","getBoxLayoutParams","isContainLabel","gridRect","getWidth","getHeight","axesList","adjustAxes","coordBase","axisExtentSum","updateAxisTransform","labelUnionRect","axisIndex","axesMapOnDim","getCartesian","xAxisIndex","yAxisIndex","coordList","getCartesians","_findConvertTarget","cartesian","coordsList","componentIndex","axisPositionUsed","axesCount","eachComponent","createAxisCreator","dimName","isAxisUsedInTheGrid","isCategory","master","unionExtent","unionExtentFromData","eachSeries","axesModelMap","getData","getTooltipAxes","baseAxes","otherAxes","baseAxis","otherAxis","grids","otherAxisDim","canOnZeroToAxis","getOnZeroRecordKey","ScaleRawExtentInfo","originalExtent","_prepareParams","NaN","_dataMin","_dataMax","isOrdinal","_isOrdinal","_needCrossZero","modelMinRaw","_modelMinRaw","_modelMinNum","parseAxisModelMinMax","modelMaxRaw","_modelMaxRaw","_modelMaxNum","_axisDataLen","boundaryGapArr","_boundaryGapInner","calculate","dataMin","dataMax","axisDataLen","boundaryGapInner","span","minFixed","maxFixed","determinedMin","_determinedMin","determinedMax","_determinedMax","modifyDataMinMax","minMaxName","val","DATA_MIN_MAX_ATTR","setDeterminedMinMax","DETERMINED_MIN_MAX_ATTR","freeze","frozen","minMax","getScaleExtent","rawExtentResult","rawExtentInfo","ensureScaleRawExtentInfo","setBlank","barSeriesModels","isBaseAxisAndHasBarSeries_1","barWidthAndOffset","adjustedScale","axisLength","barsOnCurrentAxis","undefined","minOverflow","offset","maxOverflow","totalOverFlow","oldRange","overflowBuffer","adjustScaleForOverflow","fixMin","fixMax","niceScaleExtent","extentInfo","Log","base","niceExtent","minInterval","maxInterval","setInterval","createScaleByModel","Ordinal","ordinalMeta","Time","locale","getLocaleModel","useUTC","Scale","getClass","Interval","ifAxisCrossZero","makeLabelFormatter","cb","tpl","categoryTickStart","getFormattedLabel","label","getAxisRawValue","level","estimateLabelUnionRect","realNumberScaleTicks","categoryScaleExtent","textRect","rotateRadians","beforeWidth","beforeHeight","afterWidth","afterHeight","axisLabelModel","unrotatedSingleRect","getTextRect","singleRect","rotatedRect","getOptionCategoryInterval","shouldShowAllLabels","getDataDimensionsOnAxis","dataDimMap","mapDimensionsAll","dataDim"],"mappings":"oNAkDO,SAASA,EAAOC,EAAWC,EAAWC,GAC3CA,EAAMA,GAAO,GACb,IAAIC,EAAOH,EAAUI,iBACjBC,EAAOJ,EAAUI,KACjBN,EAAS,GACTO,EAAoBD,EAAKE,kBAAkB,GAC3CC,EAAkBH,EAAKI,SACvBC,EAAeJ,EAAoB,SAAWE,EAC9CG,EAAUN,EAAKO,IACfC,KAAOV,EAAKW,UACZC,EAAY,CAACF,KAAKG,EAAGH,KAAKG,EAAIH,KAAKI,MAAOJ,KAAKK,EAAGL,KAAKK,EAAIL,KAAKM,QAChEC,EAAM,CACRC,KAAM,EACNC,MAAO,EACPC,IAAK,EACLC,OAAQ,EACRC,OAAQ,GAENC,EAAazB,EAAU0B,IAAI,WAAa,EACxCC,EAAuB,MAAZjB,EAAkB,CAACI,EAAU,GAAKW,EAAYX,EAAU,GAAKW,GAAc,CAACX,EAAU,GAAKW,EAAYX,EAAU,GAAKW,GAErI,GAAIpB,EAAmB,CACrB,IAAIuB,EAAcvB,EAAkBwB,cAAcxB,EAAkByB,YAAY,IAChFH,EAASR,EAAIK,QAAUO,KAAKC,IAAID,KAAKE,IAAIL,EAAaD,EAAS,IAAKA,EAAS,IAI/E7B,EAAOU,SAAW,CAAa,MAAZE,EAAkBiB,EAASR,EAAIV,IAAiBK,EAAU,GAAgB,MAAZJ,EAAkBiB,EAASR,EAAIV,IAAiBK,EAAU,IAE3IhB,EAAOoC,SAAWH,KAAKI,GAAK,GAAiB,MAAZzB,EAAkB,EAAI,GAQvDZ,EAAOsC,eAAiBtC,EAAOuC,cAAgBvC,EAA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trB,KAAKygB,IAAI+K,EAAexrB,KAAKmhB,IAAImK,IACnF,IAAIrjB,EAAA,EAAaojB,EAASrsB,EAAGqsB,EAASnsB,EAAGusB,EAAYC,IAZrE7sB,KAAOA,KAAKiS,MAAMgb,GAAcjtB,KAAOitB,EAGzC,OAAOjtB,MAkBF,SAASmtB,EAA0B5N,GACxC,IAAI3K,EAAW2K,EAAMze,IAAI,YACzB,OAAmB,MAAZ8T,EAAmB,OAASA,EAQ9B,SAASwY,EAAoB5tB,GAClC,MAAqB,aAAdA,EAAK6D,MAA2E,IAApD8pB,EAA0B3tB,EAAK8b,iBAE7D,SAAS+R,EAAwB7lB,KAAM1H,GAE5C,IAAIwtB,EAAa,GAajB,OATA,IAAY9lB,KAAK+lB,iBAAiBztB,IAAU,SAAU0tB,GAOpDF,EAAW,YAAoB9lB,KAAMgmB,KAAY,KAE5C,IAAYF,G","file":"vendors~app~60da9140.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 { 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 * 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 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*/\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*/\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\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*/\n// Fix for 南海诸岛\nimport * as zrUtil from 'zrender/lib/core/util';\nimport { GeoJSONRegion } from '../Region';\nvar geoCoord = [126, 25];\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 regions.push(new GeoJSONRegion('南海诸岛', 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*/\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*/\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 args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var _this = _super.apply(this, args) || 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*/\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 { __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 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 * 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, reserved, 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));\n out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal));\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, out) {\n out = 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]));\n out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]));\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 * 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*/\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 { 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*/\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}"],"sourceRoot":""}