{"version":3,"sources":["webpack:///./node_modules/echarts/lib/component/dataset.js","webpack:///./node_modules/echarts/lib/coord/axisModelCommonMixin.js","webpack:///./node_modules/echarts/lib/chart/helper/createListFromArray.js","webpack:///./node_modules/echarts/lib/config.js","webpack:///./node_modules/echarts/lib/coord/axisHelper.js","webpack:///./node_modules/echarts/lib/coord/Axis.js","webpack:///./node_modules/echarts/lib/coord/geo/parseGeoJson.js","webpack:///./node_modules/echarts/lib/chart/helper/createRenderPlanner.js","webpack:///./node_modules/echarts/lib/coord/axisTickLabelBuilder.js","webpack:///./node_modules/echarts/lib/coord/geo/mapDataStorage.js","webpack:///./node_modules/echarts/lib/coord/geo/Region.js"],"names":["ComponentModel","ComponentView","_sourceHelper","detectSourceFormat","_sourceType","SERIES_LAYOUT_BY_COLUMN","extend","type","defaultOption","seriesLayoutBy","sourceHeader","dimensions","source","optionUpdated","this","zrUtil","_default","getMin","origin","option","min","rangeStart","axis","eqNaN","scale","parse","getMax","max","rangeEnd","getNeedCrossZero","getCoordSysModel","noop","setRange","resetRange","module","exports","List","createDimensions","SOURCE_FORMAT_ORIGINAL","_dimensionHelper","getDimensionTypeByAxis","_model","getDataItemValue","CoordinateSystem","_referHelper","getCoordSysInfoBySeries","Source","_dataStackHelper","enableDataStack","makeSeriesEncodeForAxisCoordSys","createListFromArray","seriesModel","opt","isInstance","seriesDataToSource","coordSysDimDefs","coordSysName","get","registeredCoordSys","coordSysInfo","map","coordSysDims","dim","dimInfo","name","axisModel","axisMap","axisType","getDimensionsInfo","slice","firstCategoryDimIndex","hasNameEncode","dimInfoList","coordDimensions","generateCoord","encodeDefaulter","useEncodeDefaulter","curry","each","dimIndex","coordDim","categoryAxisModel","categoryAxisMap","ordinalMeta","getOrdinalMeta","otherDims","itemName","stackCalculationInfo","list","setCalculationInfo","dimValueGetter","isNeedCompleteOrdinalData","itemOpt","dimName","dataIndex","defaultDimValueGetter","hasItemOption","initData","sourceFormat","sampleItem","firstDataNotNull","data","isArray","i","length","dev","window","__DEV__","global","_config","OrdinalScale","IntervalScale","Scale","numberUtil","_barGrid","prepareLayoutBarSeries","makeColumnLayout","retrieveColumnLayout","BoundingRect","getScaleExtent","model","axisDataLen","boundaryGap","span","scaleType","originalExtent","getExtent","getCategories","parsePercent","Math","abs","fixMin","fixMax","NaN","isFinite","setBlank","categories","ecModel","isBaseAxisAndHasBarSeries","barSeriesModels","getBaseAxis","barWidthAndOffset","adjustedScale","adjustScaleForOverflow","extent","axisExtent","axisLength","barsOnCurrentAxis","undefined","minOverflow","Infinity","item","offset","maxOverflow","width","totalOverFlow","oldRange","oldRangePercentOfNew","overflowBuffer","niceScaleExtent","extentInfo","splitNumber","base","setExtent","niceExtent","minInterval","maxInterval","interval","setInterval","createScaleByModel","getClass","create","ifAxisCrossZero","dataExtent","makeLabelFormatter","labelFormatter","getLabelModel","categoryTickStart","tpl","val","getLabel","replace","tickValue","idx","getAxisRawValue","tick","value","estimateLabelUnionRect","isBlank","realNumberScaleTicks","tickCount","isCategory","categoryScaleExtent","count","getTicks","rect","axisLabelModel","step","ceil","label","unrotatedSingleRect","getTextRect","singleRect","rotateTextRect","union","textRect","rotate","rotateRadians","PI","boundingBox","plain","beforeWidth","beforeHeight","height","afterWidth","cos","sin","afterHeight","rotatedRect","x","y","getOptionCategoryInterval","shouldShowAllLabels","_util","_number","linearMap","getPixelPrecision","round","_axisTickLabelBuilder","createAxisTicks","createAxisLabels","calculateCategoryInterval","NORMALIZED_EXTENT","Axis","_extent","inverse","onBand","fixExtentWithBands","nTick","size","len","margin","fixOnBandTicksCoords","ticksCoords","alignWithLabel","clamp","ticksLen","last","diffSize","coord","crossLen","shift","ticksItem","push","littleThan","unshift","pop","a","b","prototype","constructor","contain","containData","start","end","dataToCoord","normalize","coordToData","t","pointToData","point","getTicksCoords","tickModel","getTickModel","result","ticks","getMinorTicksCoords","minorTickModel","getModel","minorTicks","getMinorTicks","minorTicksCoords","minorTicksGroup","minorTick","getViewLabels","labels","getBandWidth","isHorizontal","getRotate","Region","decode","json","UTF8Encoding","encodeScale","UTF8Scale","features","f","feature","geometry","coordinates","encodeOffsets","c","coordinate","decodePolygon","c2","polygon","prevX","prevY","charCodeAt","geoJson","nameProperty","filter","featureObj","properties","geo","geometries","exterior","interiors","region","cp","makeInner","inner","fields","pipelineContext","originalLarge","large","originalProgressive","progressiveRender","progressive","textContain","_axisHelper","makeCategoryLabels","makeRealNumberLabels","makeCategoryTicks","labelModel","makeCategoryLabelsActually","labelCategoryInterval","numericLabelInterval","labelsCache","getListCache","optionLabelInterval","listCacheGet","isFunction","makeLabelsByCustomizedCategoryInterval","makeAutoCategoryInterval","makeLabelsByNumericCategoryInterval","listCacheSet","tickCategoryInterval","ticksCache","optionTickInterval","labelsResult","labelItem","formattedLabel","rawLabel","prop","cache","key","autoInterval","params","fetchAutoCategoryIntervalCalculationParams","rotation","axisRotate","labelRotate","ordinalScale","ordinalExtent","floor","unitSpan","unitW","unitH","maxW","maxH","getBoundingRect","font","dw","dh","isNaN","lastAutoInterval","lastTickCount","axisExtend0","axisExtend1","getFont","categoryInterval","onlyTick","startTick","showAllLabel","includeMinLabel","includeMaxLabel","addItem","tVal","createHashMap","isString","_parseSVG","assert","parseXML","storage","registerMap","mapName","rawGeoJson","rawSpecialAreas","records","svg","specialAreas","record","parsers","set","retrieveMap","geoJSON","JSON","Function","svgXML","bbox","vec2","polygonContain","center","_rect","MAX_NUMBER","Number","MAX_VALUE","min2","max2","fromPoints","loopGeo","k","transformTo","aspect","target","transform","calculateTransform","p","applyTransform","h","copy","cloneShallow","newRegion"],"mappings":"qGAoBA,IAAIA,EAAiB,EAAQ,QAEzBC,EAAgB,EAAQ,QAExBC,EAAgB,EAAQ,QAExBC,EAAqBD,EAAcC,mBAEnCC,EAAc,EAAQ,QAEtBC,EAA0BD,EAAYC,wBA6B1CL,EAAeM,OAAO,CACpBC,KAAM,UAKNC,cAAe,CAEbC,eAAgBJ,EAEhBK,aAAc,KACdC,WAAY,KACZC,OAAQ,MAEVC,cAA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GAAIF,GAK5DvO,EAAOrL,KAAKgZ,MACZ3N,EAAK4O,KAAKN,GAEV3Z,KAAK+Y,OAAS,CAAC1N,EAAKwB,EAAIxB,EAAKzC,MAAQ,EAAGyC,EAAKyB,EAAIzB,EAAKkB,OAAS,IAEjE2N,aAAc,SAAUhX,GACd,MAARA,IAAiBA,EAAOlD,KAAKkD,MAC7B,IAAIiX,EAAY,IAAIhJ,EAAOjO,EAAMlD,KAAK6S,WAAY7S,KAAK+Y,QAIvD,OAHAoB,EAAUnB,MAAQhZ,KAAKgZ,MACvBmB,EAAUV,YAAc,KAEjBU,IAGX,IAAIja,EAAWiR,EACf/P,EAAOC,QAAUnB","file":"js/chunk-b9dc32e6.f3299e78.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\nvar ComponentModel = require(\"../model/Component\");\n\nvar ComponentView = require(\"../view/Component\");\n\nvar _sourceHelper = require(\"../data/helper/sourceHelper\");\n\nvar detectSourceFormat = _sourceHelper.detectSourceFormat;\n\nvar _sourceType = require(\"../data/helper/sourceType\");\n\nvar SERIES_LAYOUT_BY_COLUMN = _sourceType.SERIES_LAYOUT_BY_COLUMN;\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 * This module is imported by echarts directly.\n *\n * Notice:\n * Always keep this file exists for backward compatibility.\n * Because before 4.1.0, dataset is an optional component,\n * some users may import this module manually.\n */\nComponentModel.extend({\n type: 'dataset',\n\n /**\n * @protected\n */\n defaultOption: {\n // 'row', 'column'\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n // null/'auto': auto detect header, see \"module:echarts/data/helper/sourceHelper\"\n sourceHeader: null,\n dimensions: null,\n source: null\n },\n optionUpdated: function () {\n detectSourceFormat(this);\n }\n});\nComponentView.extend({\n type: 'dataset'\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\nvar zrUtil = require(\"zrender/lib/core/util\");\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// import * as axisHelper from './axisHelper';\nvar _default = {\n /**\n * @param {boolean} origin\n * @return {number|string} min value or 'dataMin' or null/undefined (means auto) or NaN\n */\n getMin: function (origin) {\n var option = this.option;\n var min = !origin && option.rangeStart != null ? option.rangeStart : option.min;\n\n if (this.axis && min != null && min !== 'dataMin' && typeof min !== 'function' && !zrUtil.eqNaN(min)) {\n min = this.axis.scale.parse(min);\n }\n\n return min;\n },\n\n /**\n * @param {boolean} origin\n * @return {number|string} max value or 'dataMax' or null/undefined (means auto) or NaN\n */\n getMax: function (origin) {\n var option = this.option;\n var max = !origin && option.rangeEnd != null ? option.rangeEnd : option.max;\n\n if (this.axis && max != null && max !== 'dataMax' && typeof max !== 'function' && !zrUtil.eqNaN(max)) {\n max = this.axis.scale.parse(max);\n }\n\n return max;\n },\n\n /**\n * @return {boolean}\n */\n getNeedCrossZero: function () {\n var option = this.option;\n return option.rangeStart != null || option.rangeEnd != null ? false : !option.scale;\n },\n\n /**\n * Should be implemented by each axis model if necessary.\n * @return {module:echarts/model/Component} coordinate system model\n */\n getCoordSysModel: zrUtil.noop,\n\n /**\n * @param {number} rangeStart Can only be finite number or null/undefined or NaN.\n * @param {number} rangeEnd Can only be finite number or null/undefined or NaN.\n */\n setRange: function (rangeStart, rangeEnd) {\n this.option.rangeStart = rangeStart;\n this.option.rangeEnd = rangeEnd;\n },\n\n /**\n * Reset range\n */\n resetRange: function () {\n // rangeStart and rangeEnd is readonly.\n this.option.rangeStart = this.option.rangeEnd = null;\n }\n};\nmodule.exports = _default;","\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\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar List = require(\"../../data/List\");\n\nvar createDimensions = require(\"../../data/helper/createDimensions\");\n\nvar _sourceType = require(\"../../data/helper/sourceType\");\n\nvar SOURCE_FORMAT_ORIGINAL = _sourceType.SOURCE_FORMAT_ORIGINAL;\n\nvar _dimensionHelper = require(\"../../data/helper/dimensionHelper\");\n\nvar getDimensionTypeByAxis = _dimensionHelper.getDimensionTypeByAxis;\n\nvar _model = require(\"../../util/model\");\n\nvar getDataItemValue = _model.getDataItemValue;\n\nvar CoordinateSystem = require(\"../../CoordinateSystem\");\n\nvar _referHelper = require(\"../../model/referHelper\");\n\nvar getCoordSysInfoBySeries = _referHelper.getCoordSysInfoBySeries;\n\nvar Source = require(\"../../data/Source\");\n\nvar _dataStackHelper = require(\"../../data/helper/dataStackHelper\");\n\nvar enableDataStack = _dataStackHelper.enableDataStack;\n\nvar _sourceHelper = require(\"../../data/helper/sourceHelper\");\n\nvar makeSeriesEncodeForAxisCoordSys = _sourceHelper.makeSeriesEncodeForAxisCoordSys;\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 * @param {module:echarts/data/Source|Array} source Or raw data.\n * @param {module:echarts/model/Series} seriesModel\n * @param {Object} [opt]\n * @param {string} [opt.generateCoord]\n * @param {boolean} [opt.useEncodeDefaulter]\n */\nfunction createListFromArray(source, seriesModel, opt) {\n opt = opt || {};\n\n if (!Source.isInstance(source)) {\n source = Source.seriesDataToSource(source);\n }\n\n var coordSysName = seriesModel.get('coordinateSystem');\n var registeredCoordSys = CoordinateSystem.get(coordSysName);\n var coordSysInfo = getCoordSysInfoBySeries(seriesModel);\n var coordSysDimDefs;\n\n if (coordSysInfo) {\n coordSysDimDefs = zrUtil.map(coordSysInfo.coordSysDims, function (dim) {\n var dimInfo = {\n name: dim\n };\n var axisModel = coordSysInfo.axisMap.get(dim);\n\n if (axisModel) {\n var axisType = axisModel.get('type');\n dimInfo.type = getDimensionTypeByAxis(axisType); // dimInfo.stackable = isStackable(axisType);\n }\n\n return dimInfo;\n });\n }\n\n if (!coordSysDimDefs) {\n // Get dimensions from registered coordinate system\n coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ['x', 'y'];\n }\n\n var dimInfoList = createDimensions(source, {\n coordDimensions: coordSysDimDefs,\n generateCoord: opt.generateCoord,\n encodeDefaulter: opt.useEncodeDefaulter ? zrUtil.curry(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null\n });\n var firstCategoryDimIndex;\n var hasNameEncode;\n coordSysInfo && zrUtil.each(dimInfoList, function (dimInfo, dimIndex) {\n var coordDim = dimInfo.coordDim;\n var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);\n\n if (categoryAxisModel) {\n if (firstCategoryDimIndex == null) {\n firstCategoryDimIndex = dimIndex;\n }\n\n dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();\n }\n\n if (dimInfo.otherDims.itemName != null) {\n hasNameEncode = true;\n }\n });\n\n if (!hasNameEncode && firstCategoryDimIndex != null) {\n dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;\n }\n\n var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList);\n var list = new List(dimInfoList, seriesModel);\n list.setCalculationInfo(stackCalculationInfo);\n var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function (itemOpt, dimName, dataIndex, dimIndex) {\n // Use dataIndex as ordinal value in categoryAxis\n return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);\n } : null;\n list.hasItemOption = false;\n list.initData(source, null, dimValueGetter);\n return list;\n}\n\nfunction isNeedCompleteOrdinalData(source) {\n if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var sampleItem = firstDataNotNull(source.data || []);\n return sampleItem != null && !zrUtil.isArray(getDataItemValue(sampleItem));\n }\n}\n\nfunction firstDataNotNull(data) {\n var i = 0;\n\n while (i < data.length && data[i] == null) {\n i++;\n }\n\n return data[i];\n}\n\nvar _default = createListFromArray;\nmodule.exports = _default;","\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* 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// (1) The code `if (__DEV__) ...` can be removed by build tool.\n// (2) If intend to use `__DEV__`, this module should be imported. Use a global\n// variable `__DEV__` may cause that miss the declaration (see #6535), or the\n// declaration is behind of the using position (for example in `Model.extent`,\n// And tools like rollup can not analysis the dependency if not import).\nvar dev; // In browser\n\nif (typeof window !== 'undefined') {\n dev = window.__DEV__;\n} // In node\nelse if (typeof global !== 'undefined') {\n dev = global.__DEV__;\n }\n\nif (typeof dev === 'undefined') {\n dev = true;\n}\n\nvar __DEV__ = dev;\nexports.__DEV__ = __DEV__;","\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\nvar _config = require(\"../config\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar OrdinalScale = require(\"../scale/Ordinal\");\n\nvar IntervalScale = require(\"../scale/Interval\");\n\nvar Scale = require(\"../scale/Scale\");\n\nvar numberUtil = require(\"../util/number\");\n\nvar _barGrid = require(\"../layout/barGrid\");\n\nvar prepareLayoutBarSeries = _barGrid.prepareLayoutBarSeries;\nvar makeColumnLayout = _barGrid.makeColumnLayout;\nvar retrieveColumnLayout = _barGrid.retrieveColumnLayout;\n\nvar BoundingRect = require(\"zrender/lib/core/BoundingRect\");\n\nrequire(\"../scale/Time\");\n\nrequire(\"../scale/Log\");\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 * Get axis scale extent before niced.\n * Item of returned array can only be number (including Infinity and NaN).\n */\nfunction getScaleExtent(scale, model) {\n var scaleType = scale.type;\n var min = model.getMin();\n var max = model.getMax();\n var originalExtent = scale.getExtent();\n var axisDataLen;\n var boundaryGap;\n var span;\n\n if (scaleType === 'ordinal') {\n axisDataLen = model.getCategories().length;\n } else {\n boundaryGap = model.get('boundaryGap');\n\n if (!zrUtil.isArray(boundaryGap)) {\n boundaryGap = [boundaryGap || 0, boundaryGap || 0];\n }\n\n if (typeof boundaryGap[0] === 'boolean') {\n boundaryGap = [0, 0];\n }\n\n boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);\n boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);\n span = originalExtent[1] - originalExtent[0] || Math.abs(originalExtent[0]);\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 // FIXME\n // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used?\n // (2) When `needCrossZero` and all data is positive/negative, should it be ensured\n // that the results processed by boundaryGap are positive/negative?\n\n\n if (min === 'dataMin') {\n min = originalExtent[0];\n } else if (typeof min === 'function') {\n min = min({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n if (max === 'dataMax') {\n max = originalExtent[1];\n } else if (typeof max === 'function') {\n max = max({\n min: originalExtent[0],\n max: originalExtent[1]\n });\n }\n\n var fixMin = min != null;\n var fixMax = max != null;\n\n if (min == null) {\n min = scaleType === 'ordinal' ? axisDataLen ? 0 : NaN : originalExtent[0] - boundaryGap[0] * span;\n }\n\n if (max == null) {\n max = scaleType === 'ordinal' ? axisDataLen ? axisDataLen - 1 : NaN : originalExtent[1] + boundaryGap[1] * span;\n }\n\n (min == null || !isFinite(min)) && (min = NaN);\n (max == null || !isFinite(max)) && (max = NaN);\n scale.setBlank(zrUtil.eqNaN(min) || zrUtil.eqNaN(max) || scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length); // Evaluate if axis needs cross zero\n\n if (model.getNeedCrossZero()) {\n // Axis is over zero and min is not set\n if (min > 0 && max > 0 && !fixMin) {\n min = 0;\n } // Axis is under zero and max is not set\n\n\n if (min < 0 && max < 0 && !fixMax) {\n max = 0;\n }\n } // 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\n var ecModel = model.ecModel;\n\n if (ecModel && scaleType === 'time'\n /*|| scaleType === 'interval' */\n ) {\n var barSeriesModels = prepareLayoutBarSeries('bar', ecModel);\n var isBaseAxisAndHasBarSeries;\n zrUtil.each(barSeriesModels, function (seriesModel) {\n isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis;\n });\n\n if (isBaseAxisAndHasBarSeries) {\n // Calculate placement of bars on axis\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: fixMin,\n fixMax: fixMax\n };\n}\n\nfunction adjustScaleForOverflow(min, max, model, barWidthAndOffset) {\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; // Calulate 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}\n\nfunction niceScaleExtent(scale, model) {\n var extentInfo = getScaleExtent(scale, model);\n var extent = extentInfo.extent;\n var splitNumber = model.get('splitNumber');\n\n if (scale.type === 'log') {\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 {module:echarts/model/Model} model\n * @param {string} [axisType] Default retrieve from model.type\n * @return {module:echarts/scale/*}\n */\n\n\nfunction 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(model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(), [Infinity, -Infinity]);\n\n case 'value':\n return new IntervalScale();\n // Extended scale, like time and log\n\n default:\n return (Scale.getClass(axisType) || IntervalScale).create(model);\n }\n }\n}\n/**\n * Check if the axis corss 0\n */\n\n\nfunction 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 {module:echarts/coord/Axis} axis\n * @return {Function} Label formatter function.\n * param: {number} tickValue,\n * param: {number} idx, the index in all ticks.\n * If category axis, this param is not requied.\n * return: {string} label string.\n */\n\n\nfunction makeLabelFormatter(axis) {\n var labelFormatter = axis.getLabelModel().get('formatter');\n var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null;\n\n if (typeof labelFormatter === 'string') {\n labelFormatter = function (tpl) {\n return function (val) {\n // For category axis, get raw value; for numeric axis,\n // get foramtted label like '1,333,444'.\n val = axis.scale.getLabel(val);\n return tpl.replace('{value}', val != null ? val : '');\n };\n }(labelFormatter); // Consider empty array\n\n\n return labelFormatter;\n } else if (typeof labelFormatter === 'function') {\n return function (tickValue, 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 = tickValue - categoryTickStart;\n }\n\n return labelFormatter(getAxisRawValue(axis, tickValue), idx);\n };\n } else {\n return function (tick) {\n return axis.scale.getLabel(tick);\n };\n }\n}\n\nfunction getAxisRawValue(axis, value) {\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(value) : value;\n}\n/**\n * @param {module:echarts/coord/Axis} axis\n * @return {module:zrender/core/BoundingRect} Be null/undefined if no labels.\n */\n\n\nfunction 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 isCategory = axis.type === 'category';\n var realNumberScaleTicks;\n var tickCount;\n var categoryScaleExtent = scale.getExtent(); // Optimize for large category data, avoid call `getTicks()`.\n\n if (isCategory) {\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 tickValue = realNumberScaleTicks ? realNumberScaleTicks[i] : categoryScaleExtent[0] + i;\n var label = labelFormatter(tickValue);\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 boundingBox = textRect.plain();\n var beforeWidth = boundingBox.width;\n var beforeHeight = boundingBox.height;\n var afterWidth = beforeWidth * Math.cos(rotateRadians) + beforeHeight * Math.sin(rotateRadians);\n var afterHeight = beforeWidth * Math.sin(rotateRadians) + beforeHeight * Math.cos(rotateRadians);\n var rotatedRect = new BoundingRect(boundingBox.x, boundingBox.y, afterWidth, afterHeight);\n return rotatedRect;\n}\n/**\n * @param {module:echarts/src/model/Model} model axisLabelModel or axisTickModel\n * @return {number|String} Can be null|'auto'|number|function\n */\n\n\nfunction 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 * @return {boolean}\n */\n\n\nfunction shouldShowAllLabels(axis) {\n return axis.type === 'category' && getOptionCategoryInterval(axis.getLabelModel()) === 0;\n}\n\nexports.getScaleExtent = getScaleExtent;\nexports.niceScaleExtent = niceScaleExtent;\nexports.createScaleByModel = createScaleByModel;\nexports.ifAxisCrossZero = ifAxisCrossZero;\nexports.makeLabelFormatter = makeLabelFormatter;\nexports.getAxisRawValue = getAxisRawValue;\nexports.estimateLabelUnionRect = estimateLabelUnionRect;\nexports.getOptionCategoryInterval = getOptionCategoryInterval;\nexports.shouldShowAllLabels = shouldShowAllLabels;","\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\nvar _util = require(\"zrender/lib/core/util\");\n\nvar each = _util.each;\nvar map = _util.map;\n\nvar _number = require(\"../util/number\");\n\nvar linearMap = _number.linearMap;\nvar getPixelPrecision = _number.getPixelPrecision;\nvar round = _number.round;\n\nvar _axisTickLabelBuilder = require(\"./axisTickLabelBuilder\");\n\nvar createAxisTicks = _axisTickLabelBuilder.createAxisTicks;\nvar createAxisLabels = _axisTickLabelBuilder.createAxisLabels;\nvar calculateCategoryInterval = _axisTickLabelBuilder.calculateCategoryInterval;\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 NORMALIZED_EXTENT = [0, 1];\n/**\n * Base class of Axis.\n * @constructor\n */\n\nvar Axis = function (dim, scale, extent) {\n /**\n * Axis dimension. Such as 'x', 'y', 'z', 'angle', 'radius'.\n * @type {string}\n */\n this.dim = dim;\n /**\n * Axis scale\n * @type {module:echarts/coord/scale/*}\n */\n\n this.scale = scale;\n /**\n * @type {Array.}\n * @private\n */\n\n this._extent = extent || [0, 0];\n /**\n * @type {boolean}\n */\n\n this.inverse = false;\n /**\n * Usually true when axis has a ordinal scale\n * @type {boolean}\n */\n\n this.onBand = false;\n};\n\nAxis.prototype = {\n constructor: Axis,\n\n /**\n * If axis extent contain given coord\n * @param {number} coord\n * @return {boolean}\n */\n 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 /**\n * If axis extent contain given data\n * @param {number} data\n * @return {boolean}\n */\n containData: function (data) {\n return this.scale.contain(data);\n },\n\n /**\n * Get coord extent.\n * @return {Array.}\n */\n getExtent: function () {\n return this._extent.slice();\n },\n\n /**\n * Get precision used for formatting\n * @param {Array.} [dataExtent]\n * @return {number}\n */\n getPixelPrecision: function (dataExtent) {\n return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);\n },\n\n /**\n * Set coord extent\n * @param {number} start\n * @param {number} end\n */\n setExtent: function (start, end) {\n var extent = this._extent;\n extent[0] = start;\n extent[1] = end;\n },\n\n /**\n * Convert data to coord. Data is the rank if it has an ordinal scale\n * @param {number} data\n * @param {boolean} clamp\n * @return {number}\n */\n 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 /**\n * Convert coord to data. Data is the rank if it has an ordinal scale\n * @param {number} coord\n * @param {boolean} clamp\n * @return {number}\n */\n 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 /**\n * Convert pixel point to data in axis\n * @param {Array.} point\n * @param {boolean} clamp\n * @return {number} data\n */\n pointToData: function (point, clamp) {// Should be implemented in derived class if necessary.\n },\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 {Object} [opt]\n * @param {Model} [opt.tickModel=axis.model.getModel('axisTick')]\n * @param {boolean} [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 * @return {Array.} [{\n * coord: ...,\n * tickValue: ...\n * }, ...]\n */\n 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 (tickValue) {\n return {\n coord: this.dataToCoord(tickValue),\n tickValue: tickValue\n };\n }, this);\n var alignWithLabel = tickModel.get('alignWithLabel');\n fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);\n return ticksCoords;\n },\n\n /**\n * @return {Array.>} [{ coord: ..., tickValue: ...}]\n */\n 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 /**\n * @return {Array.} [{\n * formattedLabel: string,\n * rawLabel: axis.scale.getLabel(tickValue)\n * tickValue: number\n * }, ...]\n */\n getViewLabels: function () {\n return createAxisLabels(this).labels;\n },\n\n /**\n * @return {module:echarts/coord/model/Model}\n */\n getLabelModel: function () {\n return this.model.getModel('axisLabel');\n },\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 * @return {module:echarts/coord/model/Model}\n */\n getTickModel: function () {\n return this.model.getModel('axisTick');\n },\n\n /**\n * Get width of band\n * @return {number}\n */\n 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 /**\n * @abstract\n * @return {boolean} Is horizontal\n */\n isHorizontal: null,\n\n /**\n * @abstract\n * @return {number} Get axis rotate, by degree.\n */\n getRotate: null,\n\n /**\n * Only be called in category axis.\n * Can be overrided, consider other axes like in 3D.\n * @return {number} Auto interval for cateogry axis tick and label\n */\n calculateCategoryInterval: function () {\n return calculateCategoryInterval(this);\n }\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 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;\n each(ticksCoords, function (ticksItem) {\n ticksItem.coord -= shift / 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 * 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\nvar _default = Axis;\nmodule.exports = _default;","\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\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar Region = require(\"./Region\");\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 * @module echarts/coord/geo/parseGeoJson\n */\nfunction decode(json) {\n if (!json.UTF8Encoding) {\n return json;\n }\n\n var encodeScale = json.UTF8Scale;\n\n if (encodeScale == null) {\n encodeScale = 1024;\n }\n\n var features = json.features;\n\n for (var f = 0; f < features.length; f++) {\n var feature = features[f];\n var geometry = feature.geometry;\n var coordinates = geometry.coordinates;\n var encodeOffsets = geometry.encodeOffsets;\n\n for (var c = 0; c < coordinates.length; c++) {\n var coordinate = coordinates[c];\n\n if (geometry.type === 'Polygon') {\n coordinates[c] = decodePolygon(coordinate, encodeOffsets[c], encodeScale);\n } else if (geometry.type === 'MultiPolygon') {\n for (var c2 = 0; c2 < coordinate.length; c2++) {\n var polygon = coordinate[c2];\n coordinate[c2] = decodePolygon(polygon, encodeOffsets[c][c2], encodeScale);\n }\n }\n }\n } // Has been decoded\n\n\n json.UTF8Encoding = false;\n return json;\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/**\n * @alias module:echarts/coord/geo/parseGeoJson\n * @param {Object} geoJson\n * @param {string} nameProperty\n * @return {module:zrender/container/Group}\n */\n\n\nfunction _default(geoJson, nameProperty) {\n 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 coordinates = geo.coordinates;\n var geometries = [];\n\n if (geo.type === 'Polygon') {\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 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 Region(properties[nameProperty || 'name'], geometries, properties.cp);\n region.properties = properties;\n return region;\n });\n}\n\nmodule.exports = _default;","\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\nvar _model = require(\"../../util/model\");\n\nvar makeInner = _model.makeInner;\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 * @return {string} If large mode changed, return string 'reset';\n */\nfunction _default() {\n var inner = makeInner();\n return function (seriesModel) {\n var fields = inner(seriesModel);\n var pipelineContext = seriesModel.pipelineContext;\n var originalLarge = fields.large;\n var originalProgressive = fields.progressiveRender; // FIXME: if the planner works on a filtered series, `pipelineContext` does not\n // exists. See #11611 . Probably we need to modify this structure, see the comment\n // on `performRawSeries` in `Schedular.js`.\n\n var large = fields.large = pipelineContext && pipelineContext.large;\n var progressive = fields.progressiveRender = pipelineContext && pipelineContext.progressiveRender;\n return !!(originalLarge ^ large || originalProgressive ^ progressive) && 'reset';\n };\n}\n\nmodule.exports = _default;","\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\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar textContain = require(\"zrender/lib/contain/text\");\n\nvar _model = require(\"../util/model\");\n\nvar makeInner = _model.makeInner;\n\nvar _axisHelper = require(\"./axisHelper\");\n\nvar makeLabelFormatter = _axisHelper.makeLabelFormatter;\nvar getOptionCategoryInterval = _axisHelper.getOptionCategoryInterval;\nvar shouldShowAllLabels = _axisHelper.shouldShowAllLabels;\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 inner = makeInner();\n/**\n * @param {module:echats/coord/Axis} axis\n * @return {Object} {\n * labels: [{\n * formattedLabel: string,\n * rawLabel: string,\n * tickValue: number\n * }, ...],\n * labelCategoryInterval: number\n * }\n */\n\nfunction 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\n\nfunction createAxisTicks(axis, tickModel) {\n // Only ordinal scale support tick interval\n return axis.type === 'category' ? makeCategoryTicks(axis, tickModel) : {\n ticks: axis.scale.getTicks()\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 (tickValue, idx) {\n return {\n formattedLabel: labelFormatter(tickValue, idx),\n rawLabel: axis.scale.getLabel(tickValue),\n tickValue: tickValue\n };\n })\n };\n} // Large category data calculation is performence sensitive, and ticks and label\n// probably be fetched by multiple times. So we cache the result.\n// axis is created each time during a ec process, so we do not need to clear cache.\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\nfunction 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(tickValue), 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.axisExtend0 === axisExtent[0] && cache.axisExtend1 === 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.axisExtend0 = axisExtent[0];\n cache.axisExtend1 = 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(tVal) {\n result.push(onlyTick ? tVal : {\n formattedLabel: labelFormatter(tVal),\n rawLabel: ordinalScale.getLabel(tVal),\n tickValue: tVal\n });\n }\n\n return result;\n} // When interval is function, the result `false` means ignore the tick.\n// It is time consuming for large category data.\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 (tickValue) {\n var rawLabel = ordinalScale.getLabel(tickValue);\n\n if (categoryInterval(tickValue, rawLabel)) {\n result.push(onlyTick ? tickValue : {\n formattedLabel: labelFormatter(tickValue),\n rawLabel: rawLabel,\n tickValue: tickValue\n });\n }\n });\n return result;\n}\n\nexports.createAxisLabels = createAxisLabels;\nexports.createAxisTicks = createAxisTicks;\nexports.calculateCategoryInterval = calculateCategoryInterval;","\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\nvar _config = require(\"../../config\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar isString = _util.isString;\nvar isArray = _util.isArray;\nvar each = _util.each;\nvar assert = _util.assert;\n\nvar _parseSVG = require(\"zrender/lib/tool/parseSVG\");\n\nvar parseXML = _parseSVG.parseXML;\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 storage = createHashMap(); // For minimize the code size of common echarts package,\n// do not put too much logic in this module.\n\nvar _default = {\n // The format of record: see `echarts.registerMap`.\n // Compatible with previous `echarts.registerMap`.\n registerMap: function (mapName, rawGeoJson, rawSpecialAreas) {\n var records;\n\n if (isArray(rawGeoJson)) {\n records = rawGeoJson;\n } else if (rawGeoJson.svg) {\n records = [{\n type: 'svg',\n source: rawGeoJson.svg,\n specialAreas: rawGeoJson.specialAreas\n }];\n } else {\n // Backward compatibility.\n if (rawGeoJson.geoJson && !rawGeoJson.features) {\n rawSpecialAreas = rawGeoJson.specialAreas;\n rawGeoJson = rawGeoJson.geoJson;\n }\n\n records = [{\n type: 'geoJSON',\n source: rawGeoJson,\n specialAreas: rawSpecialAreas\n }];\n }\n\n each(records, function (record) {\n var type = record.type;\n type === 'geoJson' && (type = record.type = 'geoJSON');\n var parse = parsers[type];\n parse(record);\n });\n return storage.set(mapName, records);\n },\n retrieveMap: function (mapName) {\n return storage.get(mapName);\n }\n};\nvar parsers = {\n geoJSON: function (record) {\n var source = record.source;\n record.geoJSON = !isString(source) ? source : typeof JSON !== 'undefined' && JSON.parse ? JSON.parse(source) : new Function('return (' + source + ');')();\n },\n // 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 svg: function (record) {\n record.svgXML = parseXML(record.source);\n }\n};\nmodule.exports = _default;","\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\nvar BoundingRect = require(\"zrender/lib/core/BoundingRect\");\n\nvar bbox = require(\"zrender/lib/core/bbox\");\n\nvar vec2 = require(\"zrender/lib/core/vector\");\n\nvar polygonContain = require(\"zrender/lib/contain/polygon\");\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 * @module echarts/coord/geo/Region\n */\n\n/**\n * @param {string|Region} name\n * @param {Array} geometries\n * @param {Array.} cp\n */\nfunction Region(name, geometries, cp) {\n /**\n * @type {string}\n * @readOnly\n */\n this.name = name;\n /**\n * @type {Array.}\n * @readOnly\n */\n\n this.geometries = geometries;\n\n if (!cp) {\n var rect = this.getBoundingRect();\n cp = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n } else {\n cp = [cp[0], cp[1]];\n }\n /**\n * @type {Array.}\n */\n\n\n this.center = cp;\n}\n\nRegion.prototype = {\n constructor: Region,\n properties: null,\n\n /**\n * @return {module:zrender/core/BoundingRect}\n */\n 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\n for (var i = 0; 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 /**\n * @param {} coord\n * @return {boolean}\n */\n 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])) {\n continue loopGeo;\n }\n }\n\n return true;\n }\n }\n\n return false;\n },\n 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 cloneShallow: function (name) {\n name == null && (name = this.name);\n var newRegion = new Region(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};\nvar _default = Region;\nmodule.exports = _default;"],"sourceRoot":""}